mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-08 02:49:22 +03:00
Better constraints for zooming out from corners
This commit is contained in:
parent
8f45207820
commit
e37564e58c
@ -53,13 +53,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (self.panBounds) {
|
if (self.panBounds) {
|
||||||
var viewBounds = self.viewer.viewport.getBounds();
|
|
||||||
var center = self.viewer.viewport.getCenter();
|
var center = self.viewer.viewport.getCenter();
|
||||||
|
var currentCenter = self.viewer.viewport.getCenter(true);
|
||||||
|
var viewBounds = self.viewer.viewport.getBounds();
|
||||||
var bounds = self.panBounds.clone();
|
var bounds = self.panBounds.clone();
|
||||||
var left = bounds.x + (viewBounds.width / 2);
|
var left = Math.min(currentCenter.x, bounds.x + (viewBounds.width / 2));
|
||||||
var top = bounds.y + (viewBounds.height / 2);
|
var top = Math.min(currentCenter.y, bounds.y + (viewBounds.height / 2));
|
||||||
var right = (bounds.x + bounds.width) - (viewBounds.width / 2);
|
var right = Math.max(currentCenter.x, (bounds.x + bounds.width) - (viewBounds.width / 2));
|
||||||
var bottom = (bounds.y + bounds.height) - (viewBounds.height / 2);
|
var bottom = Math.max(currentCenter.y, (bounds.y + bounds.height) - (viewBounds.height / 2));
|
||||||
|
|
||||||
var x;
|
var x;
|
||||||
if (left <= right) {
|
if (left <= right) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user