Opened 4 years ago

Last modified 4 months 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:
Has a Patch: no 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 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by jackburton

Attachment: glitch.png added

comment:1 Changed 4 years ago by jackburton

Description: modified (diff)

comment:2 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned

comment:3 Changed 8 months ago by jackburton

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 Changed 4 months ago by stippi

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.