mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 06:06:09 +03:00
Fixed panelWidth/panelHeight calculations (fixes #1992)
This commit is contained in:
parent
70c5495fe9
commit
7d19edff34
@ -155,6 +155,10 @@ $.ReferenceStrip = function ( options ) {
|
|||||||
//Controls the position and orientation of the reference strip and sets the
|
//Controls the position and orientation of the reference strip and sets the
|
||||||
//appropriate width and height
|
//appropriate width and height
|
||||||
if ( options.width && options.height ) {
|
if ( options.width && options.height ) {
|
||||||
|
//TODO fix this - isn't correct
|
||||||
|
this.panelWidth = ( viewerSize.x * this.sizeRatio ) + 12;
|
||||||
|
this.panelHeight = ( viewerSize.y * this.sizeRatio );
|
||||||
|
|
||||||
this.element.style.width = options.width + 'px';
|
this.element.style.width = options.width + 'px';
|
||||||
this.element.style.height = options.height + 'px';
|
this.element.style.height = options.height + 'px';
|
||||||
viewer.addControl(
|
viewer.addControl(
|
||||||
@ -163,33 +167,31 @@ $.ReferenceStrip = function ( options ) {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if ( "horizontal" === options.scroll ) {
|
if ( "horizontal" === options.scroll ) {
|
||||||
this.element.style.width = (
|
this.panelWidth = ( viewerSize.x * this.sizeRatio ) + 12;
|
||||||
viewerSize.x *
|
this.panelHeight = ( viewerSize.y * this.sizeRatio );
|
||||||
options.sizeRatio *
|
|
||||||
viewer.tileSources.length
|
|
||||||
) + ( 12 * viewer.tileSources.length ) + 'px';
|
|
||||||
|
|
||||||
this.element.style.height = (
|
this.element.style.width = (
|
||||||
viewerSize.y *
|
this.panelWidth *
|
||||||
options.sizeRatio
|
viewer.tileSources.length
|
||||||
) + 'px';
|
) + 'px';
|
||||||
|
|
||||||
|
this.element.style.height = this.panelHeight + 'px';
|
||||||
|
|
||||||
viewer.addControl(
|
viewer.addControl(
|
||||||
this.element,
|
this.element,
|
||||||
{ anchor: $.ControlAnchor.BOTTOM_LEFT }
|
{ anchor: $.ControlAnchor.BOTTOM_LEFT }
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.element.style.height = (
|
this.panelWidth = ( viewerSize.x * this.sizeRatio );
|
||||||
viewerSize.y *
|
this.panelHeight = ( viewerSize.y * this.sizeRatio ) + 12;
|
||||||
options.sizeRatio *
|
|
||||||
viewer.tileSources.length
|
|
||||||
) + ( 12 * viewer.tileSources.length ) + 'px';
|
|
||||||
|
|
||||||
this.element.style.width = (
|
this.element.style.height = (
|
||||||
viewerSize.x *
|
this.panelHeight *
|
||||||
options.sizeRatio
|
viewer.tileSources.length
|
||||||
) + 'px';
|
) + 'px';
|
||||||
|
|
||||||
|
this.element.style.width = this.panelWidth + 'px';
|
||||||
|
|
||||||
viewer.addControl(
|
viewer.addControl(
|
||||||
this.element,
|
this.element,
|
||||||
{ anchor: $.ControlAnchor.TOP_LEFT }
|
{ anchor: $.ControlAnchor.TOP_LEFT }
|
||||||
@ -198,8 +200,6 @@ $.ReferenceStrip = function ( options ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.panelWidth = ( viewerSize.x * this.sizeRatio ) + 8;
|
|
||||||
this.panelHeight = ( viewerSize.y * this.sizeRatio ) + 8;
|
|
||||||
this.panels = [];
|
this.panels = [];
|
||||||
this.miniViewers = {};
|
this.miniViewers = {};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user