updates in drawers and tiled image

This commit is contained in:
Tom 2023-12-15 13:13:40 -05:00
parent 074b65bfcd
commit 9616e26dd2
4 changed files with 6 additions and 34 deletions

View File

@ -46,9 +46,8 @@
*/
class CanvasDrawer extends $.DrawerBase{
constructor(){
// pass through ...arguments to DrawerBase to support positional arguments (legacy, not preferred)
super(...arguments);
constructor(options){
super(options);
/**
* 2d drawing context for {@link OpenSeadragon.CanvasDrawer#canvas}.

View File

@ -47,26 +47,9 @@
$.DrawerBase = class DrawerBase{
constructor(options){
$.console.assert( options.viewer, "[Drawer] options.viewer is required" );
//backward compatibility for positional args while preferring more
//idiomatic javascript options object as the only argument
var args = arguments;
if( !$.isPlainObject( options ) ){
options = {
source: args[ 0 ], // Reference to Viewer tile source.
viewport: args[ 1 ], // Reference to Viewer viewport.
element: args[ 2 ] // Parent element.
};
}
$.console.assert( options.viewport, "[Drawer] options.viewport is required" );
$.console.assert( options.element, "[Drawer] options.element is required" );
if ( options.source ) {
$.console.error( "[Drawer] options.source is no longer accepted; use TiledImage instead" );
}
this.viewer = options.viewer;
this.viewport = options.viewport;
this.debugGridColor = typeof options.debugGridColor === 'string' ? [options.debugGridColor] : options.debugGridColor || $.DEFAULT_SETTINGS.debugGridColor;
@ -86,6 +69,7 @@ $.DrawerBase = class DrawerBase{
this.canvas.style.width = "100%";
this.canvas.style.height = "100%";
this.canvas.style.position = "absolute";
// set canvas.style.left = 0 so the canvas is positioned properly in ltr and rtl html
this.canvas.style.left = "0";
$.setElementOpacity( this.canvas, this.viewer.opacity, true );

View File

@ -46,17 +46,8 @@
*/
class HTMLDrawer extends $.DrawerBase{
constructor(){
// pass through ...arguments to DrawerBase to support positional arguments (legacy, not preferred)
super(...arguments);
/**
* 2d drawing context for {@link OpenSeadragon.Drawer#canvas} if it's a <canvas> element, otherwise null.
* @member {Object} context
* @memberof OpenSeadragon.Drawer#
*/
this.context = null;
constructor(options){
super(options);
}
/**

View File

@ -1710,9 +1710,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
x, y,
level,
currentTime,
numberOfTiles,
this._worldWidthCurrent,
this._worldHeightCurrent
numberOfTiles
),
drawTile = drawLevel;