mgierlasinski / MagicGradients

Draw breathtaking backgrounds in your Xamarin.Forms application. It's a kind of magic.
MIT License
369 stars 21 forks source link

Mask offset #203

Open Darkar25 opened 2 years ago

Darkar25 commented 2 years ago

Is there a way to offset a mask?looks like i can only resize it and it stays in the center...

mgierlasinski commented 2 years ago

@Darkar25 There is no such way at the moment, masks are scaled from center by design. You can create your own mask and play around with virtual methods BeginLayout and EndLayout to add custom offset. Checkout TextMask as an example, there is custom positioning depending of vertical and horizontal text alignment:

https://github.com/mgierlasinski/MagicGradients/blob/0ac0cb340ebc2873968889bab3fbd1905538611b/src/MagicGradients/Masks/TextMask.cs#L95