mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
remove forced transparency from images in drawercomparison demo. change from context2d naming to canvas.
This commit is contained in:
parent
cc412f0a20
commit
048b43e196
@ -59,7 +59,7 @@ module.exports = function(grunt) {
|
|||||||
"src/overlay.js",
|
"src/overlay.js",
|
||||||
"src/drawerbase.js",
|
"src/drawerbase.js",
|
||||||
"src/htmldrawer.js",
|
"src/htmldrawer.js",
|
||||||
"src/context2ddrawer.js",
|
"src/canvasdrawer.js",
|
||||||
"src/webgldrawer.js",
|
"src/webgldrawer.js",
|
||||||
"src/viewport.js",
|
"src/viewport.js",
|
||||||
"src/tiledimage.js",
|
"src/tiledimage.js",
|
||||||
|
@ -35,9 +35,9 @@
|
|||||||
(function( $ ){
|
(function( $ ){
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Context2dDrawer
|
* @class CanvasDrawer
|
||||||
* @memberof OpenSeadragon
|
* @memberof OpenSeadragon
|
||||||
* @classdesc Default implementation of Context2dDrawer for an {@link OpenSeadragon.Viewer}.
|
* @classdesc Default implementation of CanvasDrawer for an {@link OpenSeadragon.Viewer}.
|
||||||
* @param {Object} options - Options for this Drawer.
|
* @param {Object} options - Options for this Drawer.
|
||||||
* @param {OpenSeadragon.Viewer} options.viewer - The Viewer that owns this Drawer.
|
* @param {OpenSeadragon.Viewer} options.viewer - The Viewer that owns this Drawer.
|
||||||
* @param {OpenSeadragon.Viewport} options.viewport - Reference to Viewer viewport.
|
* @param {OpenSeadragon.Viewport} options.viewport - Reference to Viewer viewport.
|
||||||
@ -45,7 +45,7 @@
|
|||||||
* @param {Number} [options.debugGridColor] - See debugGridColor in {@link OpenSeadragon.Options} for details.
|
* @param {Number} [options.debugGridColor] - See debugGridColor in {@link OpenSeadragon.Options} for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Context2dDrawer extends $.DrawerBase{
|
class CanvasDrawer extends $.DrawerBase{
|
||||||
constructor(){
|
constructor(){
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
|
|
||||||
@ -1014,7 +1014,7 @@ class Context2dDrawer extends $.DrawerBase{
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$.Context2dDrawer = Context2dDrawer;
|
$.CanvasDrawer = CanvasDrawer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -1353,7 +1353,7 @@ function OpenSeadragon( options ){
|
|||||||
* @property {Object} webgl - options if the WebGLDrawer is used.
|
* @property {Object} webgl - options if the WebGLDrawer is used.
|
||||||
* Set 'continuousTileFresh: true' if tile data is modified programmatically
|
* Set 'continuousTileFresh: true' if tile data is modified programmatically
|
||||||
* by filtering plugins or similar.
|
* by filtering plugins or similar.
|
||||||
* @property {Object} context2d - options if the Context2dDrawer is used
|
* @property {Object} context2d - options if the CanvasDrawer is used
|
||||||
* @property {Object} html - options if the HTMLDrawer is used
|
* @property {Object} html - options if the HTMLDrawer is used
|
||||||
* @property {Object} custom - options if a custom drawer is used
|
* @property {Object} custom - options if a custom drawer is used
|
||||||
*/
|
*/
|
||||||
|
@ -461,7 +461,7 @@ $.Viewer = function( options ) {
|
|||||||
let optsKey = null;
|
let optsKey = null;
|
||||||
// replace text-based option with appropriate constructor
|
// replace text-based option with appropriate constructor
|
||||||
if (Drawer === 'canvas'){
|
if (Drawer === 'canvas'){
|
||||||
Drawer = $.Context2dDrawer;
|
Drawer = $.CanvasDrawer;
|
||||||
optsKey = 'canvas';
|
optsKey = 'canvas';
|
||||||
} else if (Drawer === 'html'){
|
} else if (Drawer === 'html'){
|
||||||
Drawer = $.HTMLDrawer;
|
Drawer = $.HTMLDrawer;
|
||||||
|
@ -14,7 +14,7 @@ const labels = {
|
|||||||
duomo: 'Duomo',
|
duomo: 'Duomo',
|
||||||
}
|
}
|
||||||
|
|
||||||
//Double viewer setup for comparison - Context2dDrawer and WebGLDrawer
|
//Double viewer setup for comparison - CanvasDrawer and WebGLDrawer
|
||||||
// viewer1: canvas drawer
|
// viewer1: canvas drawer
|
||||||
let viewer1 = window.viewer1 = OpenSeadragon({
|
let viewer1 = window.viewer1 = OpenSeadragon({
|
||||||
id: "canvasdrawer",
|
id: "canvasdrawer",
|
||||||
@ -281,7 +281,7 @@ function addTileSource(viewer, image, checkbox){
|
|||||||
let item = ev.item;
|
let item = ev.item;
|
||||||
let field = viewer === viewer1 ? 'item1' : 'item2';
|
let field = viewer === viewer1 ? 'item1' : 'item2';
|
||||||
$(checkbox).data(field,item);
|
$(checkbox).data(field,item);
|
||||||
item.source.hasTransparency = ()=>true; //simulate image with transparency, to show seams in default renderer
|
// item.source.hasTransparency = ()=>true; //simulate image with transparency, to show seams in default renderer
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user