mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-31 23:21:42 +03:00
Merge pull request #26 from Ventero/patch-1
Make sure navigator has non-negative width/height
This commit is contained in:
commit
0fddd1a61d
@ -209,8 +209,12 @@ $.extend( $.Navigator.prototype, $.EventHandler.prototype, $.Viewer.prototype, {
|
|||||||
|
|
||||||
style.top = topleft.y + 'px';
|
style.top = topleft.y + 'px';
|
||||||
style.left = topleft.x + 'px';
|
style.left = topleft.x + 'px';
|
||||||
style.width = ( Math.abs( topleft.x - bottomright.x ) - 3 ) + 'px';
|
// TODO: What's this magic number mean?
|
||||||
style.height = ( Math.abs( topleft.y - bottomright.y ) - 3 ) + 'px';
|
var width = Math.abs( topleft.x - bottomright.x ) - 3;
|
||||||
|
var height = Math.abs( topleft.y - bottomright.y ) - 3;
|
||||||
|
// make sure width and height are non-negative so IE doesn't throw
|
||||||
|
style.width = Math.max( width, 0 ) + 'px';
|
||||||
|
style.height = Math.max( height, 0 ) + 'px';
|
||||||
|
|
||||||
}( this.displayRegion.style ));
|
}( this.displayRegion.style ));
|
||||||
}
|
}
|
||||||
@ -285,4 +289,4 @@ function onCanvasScroll( tracker, position, scroll, shift ) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}( OpenSeadragon ));
|
}( OpenSeadragon ));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user