mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix zoom centering when zooming with keyboard shortcuts
This commit is contained in:
@@ -278,7 +278,7 @@
|
|||||||
var step = zoomMultiplier * this.getZoomStep_();
|
var step = zoomMultiplier * this.getZoomStep_();
|
||||||
this.setZoom_(this.renderer.getZoom() + step);
|
this.setZoom_(this.renderer.getZoom() + step);
|
||||||
|
|
||||||
if (centerCoords) {
|
if (typeof centerCoords === 'object') {
|
||||||
var xRatio = (centerCoords.x - off.x) / oldWidth;
|
var xRatio = (centerCoords.x - off.x) / oldWidth;
|
||||||
var yRatio = (centerCoords.y - off.y) / oldHeight;
|
var yRatio = (centerCoords.y - off.y) / oldHeight;
|
||||||
var newWidth = this.getContainerWidth_() / this.renderer.getZoom();
|
var newWidth = this.getContainerWidth_() / this.renderer.getZoom();
|
||||||
|
|||||||
Reference in New Issue
Block a user