From 881e430cadefaeb0731eff6645c35379cef15c23 Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Sun, 12 Jul 2015 15:46:32 -0400 Subject: [PATCH] fix previous effort to make svg width/height/viewBox int only --- pd/nw/pdgui.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index c020296a9..8ccca48cb 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -3582,27 +3582,26 @@ function do_getscroll(cid) { height = bbox.y > 0 ? bbox.y + bbox.height : bbox.height; if (width === 0) { width = patchwin[cid].window.document.body.clientWidth; - // Convert to int by dropping everything after the decimal place. - // Previously I was having trouble with the DOM height and width - // setters having a different precision than the viewBox, leading - // to a subtle rendering bug. - // Since the patchsvg isn't going to be transformed at all, ints - // should work just fine here. - width |= 0; } if (height === 0) { height = patchwin[cid].window.document.body.clientHeight; - height |= 0; } + // Since we don't do any transformations on the patchsvg, + // let's try just using ints for the height/width/viewBox + // to keep things simple. + width |= 0; // drop everything to the right of the decimal point + height |= 0; configure_item(svg, { viewBox: [bbox.x > 0 ? 0 : bbox.x, bbox.y > 0 ? 0 : bbox.y, width, height] - .join(" ") + .join(" "), + width: width, + height: height }); - svg.width.baseVal.valueAsString = width; - svg.height.baseVal.valueAsString = height; +// svg.width.baseVal.valueAsString = width; +// svg.height.baseVal.valueAsString = height; // console.log("x is " + bbox.x); // console.log("y is " + bbox.x); // console.log("width is " + bbox.width); -- GitLab