Skip to content

Commit

Permalink
Make sure resizing works with integer pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
bago committed Nov 10, 2022
1 parent 8be1758 commit c706e5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/js/bindings/extresizable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

Expand All @@ -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) {
Expand Down

0 comments on commit c706e5d

Please sign in to comment.