From 048b43e1967a096a6f864c17fc0f3fb4c3c8447d Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 30 Jun 2023 16:06:17 -0400 Subject: [PATCH] remove forced transparency from images in drawercomparison demo. change from context2d naming to canvas. --- Gruntfile.js | 2 +- src/{context2ddrawer.js => canvasdrawer.js} | 8 ++++---- src/openseadragon.js | 2 +- src/viewer.js | 2 +- test/demo/drawercomparison.js | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) rename src/{context2ddrawer.js => canvasdrawer.js} (99%) diff --git a/Gruntfile.js b/Gruntfile.js index 850bb9e0..82c0d0ca 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -59,7 +59,7 @@ module.exports = function(grunt) { "src/overlay.js", "src/drawerbase.js", "src/htmldrawer.js", - "src/context2ddrawer.js", + "src/canvasdrawer.js", "src/webgldrawer.js", "src/viewport.js", "src/tiledimage.js", diff --git a/src/context2ddrawer.js b/src/canvasdrawer.js similarity index 99% rename from src/context2ddrawer.js rename to src/canvasdrawer.js index 4516856c..62c49d85 100644 --- a/src/context2ddrawer.js +++ b/src/canvasdrawer.js @@ -35,9 +35,9 @@ (function( $ ){ /** - * @class Context2dDrawer + * @class CanvasDrawer * @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 {OpenSeadragon.Viewer} options.viewer - The Viewer that owns this Drawer. * @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. */ -class Context2dDrawer extends $.DrawerBase{ +class CanvasDrawer extends $.DrawerBase{ constructor(){ super(...arguments); @@ -1014,7 +1014,7 @@ class Context2dDrawer extends $.DrawerBase{ }; } } -$.Context2dDrawer = Context2dDrawer; +$.CanvasDrawer = CanvasDrawer; /** diff --git a/src/openseadragon.js b/src/openseadragon.js index cfa80df5..b63aaf6f 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -1353,7 +1353,7 @@ function OpenSeadragon( options ){ * @property {Object} webgl - options if the WebGLDrawer is used. * Set 'continuousTileFresh: true' if tile data is modified programmatically * 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} custom - options if a custom drawer is used */ diff --git a/src/viewer.js b/src/viewer.js index f39e6251..93024c7c 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -461,7 +461,7 @@ $.Viewer = function( options ) { let optsKey = null; // replace text-based option with appropriate constructor if (Drawer === 'canvas'){ - Drawer = $.Context2dDrawer; + Drawer = $.CanvasDrawer; optsKey = 'canvas'; } else if (Drawer === 'html'){ Drawer = $.HTMLDrawer; diff --git a/test/demo/drawercomparison.js b/test/demo/drawercomparison.js index 7edb0101..a569419d 100644 --- a/test/demo/drawercomparison.js +++ b/test/demo/drawercomparison.js @@ -14,7 +14,7 @@ const labels = { duomo: 'Duomo', } -//Double viewer setup for comparison - Context2dDrawer and WebGLDrawer +//Double viewer setup for comparison - CanvasDrawer and WebGLDrawer // viewer1: canvas drawer let viewer1 = window.viewer1 = OpenSeadragon({ id: "canvasdrawer", @@ -281,7 +281,7 @@ function addTileSource(viewer, image, checkbox){ let item = ev.item; let field = viewer === viewer1 ? 'item1' : 'item2'; $(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 }); } }