fix area calculation

This commit is contained in:
rolux 2015-02-05 07:38:42 +00:00
parent c946fa876e
commit b69f125b97

View file

@ -311,10 +311,10 @@ Ox.ImageViewer = function(options, self) {
: self.options.width / self.options.imageWidth;
}
return [
Math.max(center[0] - self.options.width / 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[1] + self.options.height / 2 * zoom, self.options.imageHeight)
Math.max(center[0] - self.options.width / 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[1] + self.options.height / 2 / zoom, self.options.imageHeight)
];
}