From 3158ead2826579ea593f9741d132ff6787f39afa Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Fri, 25 Dec 2015 21:17:58 -0500 Subject: [PATCH] force all viewbox values to ints-- fixes a bug with objects positioned at negative coords --- pd/nw/pdgui.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index 074811f07..c14f280d0 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -3451,7 +3451,7 @@ function do_getscroll(cid) { // negative x or y. // To implement the Pd-l2ork behavior, the top-left of the canvas should // always be the topmost, leftmost object. - width = bbox.x > 0 ? bbox.x + bbox.width : bbox.width, + width = bbox.x > 0 ? bbox.x + bbox.width : bbox.width; height = bbox.y > 0 ? bbox.y + bbox.height : bbox.height; x = bbox.x > 0 ? 0 : bbox.x, y = bbox.y > 0 ? 0 : bbox.y; @@ -3479,6 +3479,8 @@ function do_getscroll(cid) { height |= 0; min_width |= 0; min_height |= 0; + x |= 0; + y |= 0; if (width < min_width) { width = min_width; } -- GitLab