The function PolyBezierArcPoints in graphmath.pp is wrong for negative values (clockwise drawing)
Original Reporter info from Mantis: giuliano
-
Reporter name: G. Colla
Original Reporter info from Mantis: giuliano
- Reporter name: G. Colla
Description:
The PolyBezierArcPoints function converts a provided starting Angle and AngleLength in an array of points to use with a Poligon or a Polyline. It uses BezierArcPoints.
This function is called by TWidgetSet.RadialPie if not overriden by widgetset implementation.
Positive values of Angle and AngleLength mean counter-clockwise drawing, negative value mean clockise drawing.
If abs(AngleLength) is > 45°, it is subdivided into portions <= 45° to comply with BezierArcPoints requirements.
With positive values it always provides a correct result. With negative values above and abs(AngleLength) > 45° it provides wrong results.
Steps to reproduce:
Call Canvas.RadialPie both with a positive and a negative value of Angle16DegLength greater than 45° (e.g. 90°) and observe the result.
Screenshot with Positive value on GTK2:
http://www.bononiadocta.it/Lazarus/Gtk2-CClockwise.png
Screenshot with negative value on GTK2:
http://www.bononiadocta.it/Lazarus/Gtk2-Clockwise.png
Same using Qt widgetset which uses native implementation:
http://www.bononiadocta.it/Lazarus/Qt-CClockwise.png
http://www.bononiadocta.it/Lazarus/Qt-Clockwise.png
Additional information:
The attached patch fixes the problem.
Mantis conversion info:
- Mantis ID: 26792
- Build: r 46338
- Version: 1.3 (SVN)
- Fixed in revision: 46441 (#55ab14b3)
- Monitored by: » giuliano (G. Colla)
- Target version: 1.2.6