app_server: Restore previous rounding

46b39e837829ece251b2a5a690b86d283a95c2c5 contained a change to the
rounding for non-subpixel-precise drawing. This changes it back
from using round() to casting to int32. This also reverts a change
to StrokeLine() which meant that lines on integer pixels appeared
at the same location regardless of using B_SUBPIXEL_PRECISE or not.
On further thought, this doesn't make any sense, since it means
to treat the meaning of coordinates different for stroking and
filling. This fixes WonderBrush's brush tip preview, but breaks
Gobe Productive's caret rendering for zooms smaller than 150%.
The change to the rounding fixes #10690.
This commit is contained in:
Stephan Aßmus 2014-03-30 22:28:14 +02:00
parent 0acae24ee7
commit a87c4748e5

View File

@ -523,7 +523,7 @@ Painter::StrokeLine(BPoint a, BPoint b)
}
} else {
// Do the pixel center offset here
if (fmodf(fPenSize, 2.0) != 0.0) {
if (!fSubpixelPrecise && fmodf(fPenSize, 2.0) != 0.0) {
_Align(&a, true);
_Align(&b, true);
}
@ -531,7 +531,7 @@ Painter::StrokeLine(BPoint a, BPoint b)
fPath.move_to(a.x, a.y);
fPath.line_to(b.x, b.y);
if (fPenSize == 1.0f) {
if (!fSubpixelPrecise && fPenSize == 1.0f) {
// Tweak ends to "include" the pixel at the index,
// we need to do this in order to produce results like R5,
// where coordinates were inclusive
@ -1516,7 +1516,7 @@ Painter::_Align(float coord, bool round, bool centerOffset) const
{
// rounding
if (round)
coord = roundf(coord);
coord = (int32)coord;
// This code is supposed to move coordinates to the center of pixels,
// as AGG considers (0,0) to be the "upper left corner" of a pixel,