Opened 9 years ago

Last modified 5 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 jackburton)

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)

glitch.png (26.0 KB ) - added by jackburton 9 years ago.

Download all attachments as: .zip

Change History (5)

by jackburton, 9 years ago

Attachment: glitch.png added

comment:1 by jackburton, 9 years ago

Description: modified (diff)

comment:2 by axeld, 7 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:3 by jackburton, 6 years ago

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.

comment:4 by stippi, 5 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.

Note: See TracTickets for help on using tickets.