fix area calculation
This commit is contained in:
parent
c946fa876e
commit
b69f125b97
1 changed files with 4 additions and 4 deletions
|
@ -311,10 +311,10 @@ Ox.ImageViewer = function(options, self) {
|
||||||
: self.options.width / self.options.imageWidth;
|
: self.options.width / self.options.imageWidth;
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
Math.max(center[0] - self.options.width / 2 * zoom, 0),
|
Math.max(center[0] - self.options.width / 2 / zoom, 0),
|
||||||
Math.max(center[1] - self.options.height / 2 * zoom, 0),
|
Math.max(center[1] - self.options.height / 2 / zoom, 0),
|
||||||
Math.min(center[0] + self.options.width / 2 * zoom, self.options.imageWidth),
|
Math.min(center[0] + self.options.width / 2 / zoom, self.options.imageWidth),
|
||||||
Math.min(center[1] + self.options.height / 2 * zoom, self.options.imageHeight)
|
Math.min(center[1] + self.options.height / 2 / zoom, self.options.imageHeight)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue