Athens and ellipse drawing (again)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Athens and ellipse drawing (again)

Nicolai Hess
drawing an ellipse by drawing a non-uniform-scaled circle
works, but the border is scaled as well.

in Roassal2, ellipse shapes always use a small 1px border
(https://code.google.com/p/moose-technology/issues/detail?id=1097)

As described in the above 2 threads, it is possible to draw an ellipse
with uniform border with cairo, and it is possible to do this
with athens, although athens does not provide this as a public api.

A much easier solution than the one I suggested in
https://code.google.com/p/moose-technology/issues/detail?id=1097
is to use athens "paintTransform".

We need to add
AthensCairoCanvas>>setPaintMatrix
(similiar to setPathMatrix)

and call this in
AthensCairoStrokePaint>>#athensFillPath:on:

    self prepareForDrawingOn: aCanvas.
   
    aCanvas
        newPath;
        loadPath: aPath;
        setPaintMatrix;          "< --- new"
        stroke


what do you think?


Nicolai

Reply | Threaded
Open this post in threaded view
|

Re: Athens and ellipse drawing (again)

Igor Stasenko


On 3 December 2014 at 12:13, Nicolai Hess <[hidden email]> wrote:
drawing an ellipse by drawing a non-uniform-scaled circle
works, but the border is scaled as well.

in Roassal2, ellipse shapes always use a small 1px border
(https://code.google.com/p/moose-technology/issues/detail?id=1097)

As described in the above 2 threads, it is possible to draw an ellipse
with uniform border with cairo, and it is possible to do this
with athens, although athens does not provide this as a public api.

A much easier solution than the one I suggested in
https://code.google.com/p/moose-technology/issues/detail?id=1097
is to use athens "paintTransform".

We need to add
AthensCairoCanvas>>setPaintMatrix
(similiar to setPathMatrix)

and call this in
AthensCairoStrokePaint>>#athensFillPath:on:

    self prepareForDrawingOn: aCanvas.
   
    aCanvas
        newPath;
        loadPath: aPath;
        setPaintMatrix;          "< --- new"
        stroke


what do you think?


it looks like you discovered a bug.
the point is, that the paint matrix should affect the output.. and if it doesn't then it is a bug.
If so, feel free to post a fix.
 

Nicolai




--
Best regards,
Igor Stasenko.