1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Color brush - Fix gradient positioning

This commit is contained in:
SpoinkyNL 2020-04-19 17:28:06 +02:00
parent 92a3e0d61b
commit 8c3212451b
2 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
UseLayoutRounding="True"
FadeContentIfInactive="False"
Width="800"
Height="800"
d:DesignHeight="800"

View File

@ -77,7 +77,7 @@ namespace Artemis.Plugins.LayerBrushes.Color
private void CreateShader(SKRect pathBounds)
{
var center = new SKPoint(Layer.Bounds.MidX, Layer.Bounds.MidY);
var center = new SKPoint(pathBounds.MidX, pathBounds.MidY);
SKShader shader;
switch (GradientTypeProperty.CurrentValue)
{
@ -85,7 +85,7 @@ namespace Artemis.Plugins.LayerBrushes.Color
shader = SKShader.CreateColor(_color);
break;
case GradientType.LinearGradient:
shader = SKShader.CreateLinearGradient(new SKPoint(0, 0), new SKPoint(pathBounds.Width, 0),
shader = SKShader.CreateLinearGradient(new SKPoint(pathBounds.Left, pathBounds.Top), new SKPoint(pathBounds.Right, pathBounds.Bottom),
GradientProperty.Value.GetColorsArray(),
GradientProperty.Value.GetPositionsArray(), SKShaderTileMode.Repeat);
break;