Lazarus

Programming => Widgetset => Cocoa => Topic started by: nsl on April 04, 2019, 03:23:34 pm

Title: TPen line styles
Post by: nsl on April 04, 2019, 03:23:34 pm
This post is to promote bug #0034744  (https://bugs.freepascal.org/view.php?id=34744). I created this report many weeks ago but it has not been adopted yet.

The issue concerns lines drawn on a canvas with a line style (i.e. dotted, dashed etc.) when using macOS with the Carbon or Cocoa widget sets. The Lazarus TPen object attempts to make a MS Windows style interface to the native Core Graphics CGContext. In my view the code to emulate dashes and dotted lines is not optimum. In particular if the ‘round’ line-end style is used dashed/dotted sections run into each other. I have made some small adjustments to the code and generated a patch file.

In addition I have added code to support the MS Windows ‘Cosmetic’ line styles which are used when line width = 1.

Line styles can be tested using the standard lazarus/examples/canvas_test project.