[cairo] Unsymmetrical rotation
Blagoj Kupev
bkupev at gmail.com
Sun Mar 3 12:59:18 PST 2013
Hello,
Already tried, and does not work... as i can understand the documentation
the functions cairo_translate and cairo_rotate only modify the current
transformation matrix and then the transformation is applied when the
function cairo_set_source_surface is called. Then as i understand,
cairo_set_source_surface is doing additional matrix transformation with the
x and y offsets prior the matrix is executed.
It seems that:
cairo_translate (cr, x_origin, y_origin);
cairo_rotate (cr, (2*3.14*angle/360));
cairo_set_source_surface(cr, surf1, x, y);
Is the same as:
cairo_translate (cr, x_origin, y_origin);
cairo_rotate (cr, (2*3.14*angle/360));
cairo_translate (cr, x, y);
cairo_set_source_surface(cr, surf1, 0, 0);
Thanks,
Blagoj
On Sun, Mar 3, 2013 at 9:37 PM, Bill Spitzak <spitzak at gmail.com> wrote:
> On 03/03/2013 06:33 AM, Blagoj Kupev wrote:
>
> cairo_translate (cr, x_origin, y_origin);
>> cairo_rotate (cr, (2*3.14*angle/360));
>>
>> cairo_set_source_surface(cr, surf1, -x_origin+x_offset, -y_origin);
>> cairo_paint(cr);
>>
>
> I think this will work:
>
>
> cairo_translate (cr, x_origin, y_origin);
> cairo_rotate (cr, (2*3.14*angle/360));
> cairo_translate (cr, x_offset, 0);
> cairo_set_source_surface(cr, surf1, -x_origin, -y_origin);
>
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.**org/mailman/listinfo/cairo<http://lists.cairographics.org/mailman/listinfo/cairo>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130303/6e172ca5/attachment.html>
More information about the cairo
mailing list