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:
parent
92a3e0d61b
commit
8c3212451b
@ -12,6 +12,7 @@
|
|||||||
Background="{DynamicResource MaterialDesignPaper}"
|
Background="{DynamicResource MaterialDesignPaper}"
|
||||||
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
|
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
|
||||||
UseLayoutRounding="True"
|
UseLayoutRounding="True"
|
||||||
|
FadeContentIfInactive="False"
|
||||||
Width="800"
|
Width="800"
|
||||||
Height="800"
|
Height="800"
|
||||||
d:DesignHeight="800"
|
d:DesignHeight="800"
|
||||||
|
|||||||
@ -77,7 +77,7 @@ namespace Artemis.Plugins.LayerBrushes.Color
|
|||||||
|
|
||||||
private void CreateShader(SKRect pathBounds)
|
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;
|
SKShader shader;
|
||||||
switch (GradientTypeProperty.CurrentValue)
|
switch (GradientTypeProperty.CurrentValue)
|
||||||
{
|
{
|
||||||
@ -85,7 +85,7 @@ namespace Artemis.Plugins.LayerBrushes.Color
|
|||||||
shader = SKShader.CreateColor(_color);
|
shader = SKShader.CreateColor(_color);
|
||||||
break;
|
break;
|
||||||
case GradientType.LinearGradient:
|
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.GetColorsArray(),
|
||||||
GradientProperty.Value.GetPositionsArray(), SKShaderTileMode.Repeat);
|
GradientProperty.Value.GetPositionsArray(), SKShaderTileMode.Repeat);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user