Opened 9 years ago
Last modified 6 years ago
#12383 assigned bug
FillTrangle produces slightly different results if drawn in a BPicture
Reported by: | jackburton | Owned by: | nobody |
---|---|---|---|
Priority: | low | Milestone: | Unscheduled |
Component: | Servers/app_server | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
As shown by the FlattenPictureTest test, FillTriangle produces a slightly different result when invoked inside a BPicture. This happens because there is no FILL_TRIANGLE op in the BPicture encoding, and FillTriangle is translated to a FillPolygon call. Now, I'd expect that FillPolygon(), when called with three points, would produce the same output that FillTriangle does.
Attachments (1)
Change History (5)
by , 9 years ago
Attachment: | glitch.png added |
---|
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 6 years ago
comment:4 by , 6 years ago
Thanks for investigating, Stefano! I'll try to have a look. The offsetting by 0.5 is to get a closer match to the original BeOS drawings. It should actually only happen when stroking, not when filling. I'll need to have a closer look, but of course it would be nice if FillTriangle() and FillPolygon() produce the exact same output for the same points.
I've noticed that Painter::_DrawTriangle() (which is called for the fill_triangle op), aligns the points using the "_Align()" function with the "centerOffset" parameter set to true, while Painter::DrawPolygon() (called for the fill_polygon op) calls _Align() with the centerOffset parameter set to false. _Align(), if centerOffset is set to true, increments the point coordinates by 0.5. I don't know which one is correct, but it's what's causing this bug.