From c706e5d9ad59c3d1e3f97e94d9a265c9c6aade7c Mon Sep 17 00:00:00 2001 From: Bago Date: Thu, 10 Nov 2022 09:27:52 +0100 Subject: [PATCH] Make sure resizing works with integer pixels --- src/js/bindings/extresizable.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/bindings/extresizable.js b/src/js/bindings/extresizable.js index 92e878329..415d81492 100644 --- a/src/js/bindings/extresizable.js +++ b/src/js/bindings/extresizable.js @@ -60,8 +60,9 @@ */ }; options.resize = function(event, ui) { - // console.log("resize", ui.size.height, ui.originalSize.height, value()); - value(ui.size.height); + // the Math.round is needed to prevent non integer heights after a "non-perfeclty" size image is added to a resizable placeholder + // console.log("resize", ui.size.height, Math.round(ui.size.height), ui.originalSize.height, value()); + value(Math.round(ui.size.height)); ui.size.height = value(); }; @@ -70,7 +71,7 @@ //initialize resizable $(element).resizable(resizableOptions); - // console.log(element, "resizable init"); + // console.log(element, "resizable init", resizableOptions); //handle enabling/disabling resizable if (isEnabled !== undefined) {