[cairo] Extents under rotation
donn.ingle at gmail.com
Fri Dec 6 23:31:09 PST 2013
On 06/12/2013 17:13, Bill Spitzak wrote:
> The matrices are multiplied before this is done, so this error does not
> accumulate. For instance if you rotate by 45 degrees and then back by 45
> degrees, it will act like a rotation of 0 and produce your expected
> bounding box, rather than enlarging the bounding box twice.
I'm sure I will face these things soon when I institute picking beyond a
basic bbox hit approach.
Do you have a way to draw a tight bbox in user-space around a path?
I have tried various things like getting the extents in device space (by
doing a identity_matrix call before extents) and then using
device_to_user on each returned x,y coordinate -- in order to try get
those corners *in user space* and I just can't get it right.
I'd like to draw an X shape over my original path: At first I have a
complex shape - so I want to measure extents and thereafter substitute a
simple X shape [*] that can be drawn quickly(into user/local space) and
re-measured by extents in the future.
[*] X from top-left to bottom-right and reverse. Or just a rect, or just
four dots in the bbox corners.
More information about the cairo