Commit aefe4e72 authored by David Schnur's avatar David Schnur

Round text coordinates consistently.

The core implementation used parseInt, which was originally to catch
text values, but really only stayed due to its side-effect of flooring
the values.  The canvas implementation has never rounded coordinates.
This led to various one-pixel rendering glitches between the two
implementations.  I've fixed the problem by consistently rounding
coordinates to the nearest whole number.
parent 606c02b8
......@@ -140,7 +140,7 @@ browser, but needs to redraw with canvas text when exporting as an image.
y = Math.ceil(y - 2);
}
context.fillText(line.text, linex, y);
context.fillText(line.text, Math.round(linex), Math.round(y));
y += line.height;
}
}
......
......@@ -385,8 +385,8 @@ Licensed under the MIT license.
// Move the element to its final position within the container
info.element.css({
top: parseInt(y, 10),
left: parseInt(x, 10)
top: Math.round(y),
left: Math.round(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