From a1e1e1d2bcde421aef2dfb37bd4395c71b009a35 Mon Sep 17 00:00:00 2001 From: Evgeniy Malyarov Date: Fri, 22 Sep 2023 18:23:02 +0500 Subject: [PATCH] getZoom return 0 For mirrored in x (x=-1, y=1), result was 0 and crash project dividing by 0 --- src/view/View.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/View.js b/src/view/View.js index afab2c535..821c9165e 100644 --- a/src/view/View.js +++ b/src/view/View.js @@ -528,7 +528,7 @@ var View = Base.extend(Emitter, /** @lends View# */{ getZoom: function() { var scaling = this._decompose().scaling; // Use average since it can be non-uniform. - return (scaling.x + scaling.y) / 2; + return (Math.abs(scaling.x) + Math.abs(scaling.y)) / 2; // for mirrored in x (x=-1, y=1), result was 0 and crash project dividing by 0 }, setZoom: function(zoom) {