Multiple text decorations

39 views
Skip to first unread message

Priya

unread,
Dec 7, 2022, 1:25:46 AM12/7/22
to skia-discuss
Hi
    I want to set both underline and linethrough decorations in my text.Below is my code.

TextStyle textStyle;

textStyle.setDecorationColor(SkColorSetRGB(0, 0, 25));

textStyle.setDecoration(AllTextDecorations[1]);

textStyle.setDecoration(AllTextDecorations[3]);

    I am getting any one decorator ,not both.How to set both for my text?

Thanks in advance.

Julia Lavrova

unread,
Dec 7, 2022, 10:08:34 AM12/7/22
to skia-d...@googlegroups.com
You should concatenate decorations like this:
    textStyle.setDecoration((TextDecoration)(AllTextDecorations[1] | AllTextDecorations[3]);

--
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/05ba9e74-b1d0-4503-b780-505be90bfc08n%40googlegroups.com.

Priya

unread,
Dec 8, 2022, 2:14:49 AM12/8/22
to skia-discuss
yes, it worked. Thank you.
Reply all
Reply to author
Forward
0 new messages