Commit bb007f25 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Use ints for svg height/width/viewBox to avoid what _might_ be a Chromium rendering bug

parent c1d77e19
......@@ -3582,9 +3582,17 @@ 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;
}
configure_item(svg, {
viewBox: [bbox.x > 0 ? 0 : bbox.x,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment