Skip to content

Commit 25c5a1a

Browse files
committed
Fix canvas resize condition
Reduce limits to react on resize. Fix wrong operator
1 parent 2b6f8a7 commit 25c5a1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/base/BasePainter.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ class BasePainter {
552552

553553
if (old_h && old_w && (old_h > 0) && (old_w > 0)) {
554554
if ((old_h !== rect.height) || (old_w !== rect.width))
555-
if ((check_level > 1) || (rect.width / old_w < 0.66) || (rect.width / old_w > 1.5) ||
556-
(rect.height / old_h < 0.66) && (rect.height / old_h > 1.5)) rect.changed = true;
555+
rect.changed = (check_level > 1) || (rect.width / old_w < 0.9) || (rect.width / old_w > 1.1) ||
556+
(rect.height / old_h < 0.9) || (rect.height / old_h > 1.1);
557557
} else {
558558
rect.changed = true;
559559
}

0 commit comments

Comments
 (0)