[cairo] Problems with cairo_get_line_width and "new" semantics
Bill Spitzak
spitzak at d2.com
Fri May 19 17:52:11 PDT 2006
I think you want the dashes to be in pen space, or in their own space
that is not tied to the CTM.
This is because the main use is to switch between one (or a small set)
of dash patterns and solid, repeatedly, as portions of the drawing are
done. Since the line width is not changing, the programmer probably does
not want the dash pattern to change depending on the current transform
either.
This is not really inconsistent with Cairo using user space for all the
api, because the dash is specified with single numerical lengths, not
the xy vectors that would be needed for a coordinate api.
If, as you indicate, having a different dashCTM and penCTM is not any
harder than using penCTM for everything, then probably there should be a
call to set the dashCTM. This would replace the "dashscale" I proposed
earlier. To emulate the set-pen-width call, it would copy the CTM to
dashCTM, and scale it up by the width and put that in the penCTM. It may
also be a good idea to have set_pen_matrix() always set the dash matrix
to the same value, to avoid two calls in the common case where they want
to be the same.
Carl Worth wrote:
> So when I made the changes for the line-width-scale branch I changed
> this to use the pen matrix rather than the CTM.
>
> But know you've got me thinking about whether that's the right matrix
> to use.
More information about the cairo
mailing list