[cairo] Rectangles and Gradients

cecashon at aol.com cecashon at aol.com
Wed Oct 16 17:41:40 UTC 2019


 
Hi Uli,

Yes, create a 90 degree line from one line and compute the intersection with the other parallel line of the sheared rectangle. This will give the linear gradient control line. This works in affine space. A little funky with a perspective matrix. Mesh gradients work better there. It should be possible to use the mapped 3d to 2d matrix to do the same with cairo_pattern_set_matrix(). This is what I did with fonts but haven't been able to figure it out for linear gradients. A flat rectangle on the yz plane rotated in 3d should map to the xy plane in 2d. For now, a little geometry will have to do.

Thanks,
Eric
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20191016/8a047cf3/attachment.html>


More information about the cairo mailing list