Can Skia render svg at an angle

74 views
Skip to first unread message

Asger Jørgensen (Asger-P)

unread,
Jan 20, 2023, 7:51:20 AM1/20/23
to skia-discuss
Hi
Before I put all my time into learning Skia I would like to know if what I want to do is possible.
Lets say I have two svg files the first file I would like to draw rotated 20° to the left and second one I would like to draw rotated 20° to the right and on top of the first.
See attached example.

Can this be done ?

Thanks in advance
Asgerexample1.png

Jim Van Verth

unread,
Jan 20, 2023, 9:06:19 AM1/20/23
to skia-d...@googlegroups.com
You can use SkSVGDom and set the appropriate transform in the SkCanvas, something like:

canvas->save(); // save the current matrix and clip
canvas->rotate(20);
dom1->render(canvas);
canvas->restore(); // restore to the previous matrix and clip
canvas->save();
canvas->rotate(-20);
dom2->render(canvas);
canvas->restore();


--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/279cf0cc-a631-4eb4-81e2-7e395ed16ecan%40googlegroups.com.


--

Jim Van Verth | Software Engineer | jvan...@google.com | 919-210-7664

Asger Jørgensen (Asger-P)

unread,
Jan 20, 2023, 2:40:32 PM1/20/23
to skia-discuss
Thank you Jim.
I'll get into Skia then.:-)
Reply all
Reply to author
Forward
0 new messages