mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Fixed brush-save and adjusted render-resolution
This commit is contained in:
parent
e9d3040b64
commit
d9d828ab21
@ -63,28 +63,10 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush
|
||||
WidthProperties.Apply(LayerModel);
|
||||
OpacityProperties.Apply(LayerModel);
|
||||
|
||||
((AngularBrushPropertiesModel)LayerModel.Properties).GradientStops = GetGradientStops().Select(x => new Tuple<double, Color>(x.Offset, x.Color)).ToList();
|
||||
|
||||
LayerModel.Properties.Brush = Brush;
|
||||
LayerModel.LayerAnimation = SelectedLayerAnimation;
|
||||
}
|
||||
|
||||
private GradientStopCollection GetGradientStops()
|
||||
{
|
||||
LinearGradientBrush linearBrush = Brush as LinearGradientBrush;
|
||||
if (linearBrush != null)
|
||||
return linearBrush.GradientStops;
|
||||
|
||||
RadialGradientBrush radialBrush = Brush as RadialGradientBrush;
|
||||
if (radialBrush != null)
|
||||
return radialBrush.GradientStops;
|
||||
|
||||
SolidColorBrush solidBrush = Brush as SolidColorBrush;
|
||||
if (solidBrush != null)
|
||||
return new GradientStopCollection(new[] { new GradientStop(solidBrush.Color, 0), new GradientStop(solidBrush.Color, 1) });
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using System.Windows;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Profiles.Layers.Abstract;
|
||||
@ -51,7 +53,8 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush
|
||||
|
||||
Brush origBrush = layerModel.Brush;
|
||||
|
||||
_gradientDrawer.GradientStops = properties.GradientStops;
|
||||
//TODO DarthAffe 14.01.2017: Check if an update is needed
|
||||
_gradientDrawer.GradientStops = GetGradientStops(layerModel.Brush).Select(x => new Tuple<double, Color>(x.Offset, x.Color)).ToList();
|
||||
_gradientDrawer.Update();
|
||||
layerModel.Brush = _gradientDrawer.Brush.Clone();
|
||||
|
||||
@ -105,6 +108,23 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush
|
||||
return (layerPropertiesViewModel as AngularBrushPropertiesViewModel) ?? new AngularBrushPropertiesViewModel(layerEditorViewModel);
|
||||
}
|
||||
|
||||
private GradientStopCollection GetGradientStops(Brush brush)
|
||||
{
|
||||
LinearGradientBrush linearBrush = brush as LinearGradientBrush;
|
||||
if (linearBrush != null)
|
||||
return linearBrush.GradientStops;
|
||||
|
||||
RadialGradientBrush radialBrush = brush as RadialGradientBrush;
|
||||
if (radialBrush != null)
|
||||
return radialBrush.GradientStops;
|
||||
|
||||
SolidColorBrush solidBrush = brush as SolidColorBrush;
|
||||
if (solidBrush != null)
|
||||
return new GradientStopCollection(new[] { new GradientStop(solidBrush.Color, 0), new GradientStop(solidBrush.Color, 1) });
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush.Drawing
|
||||
|
||||
private void CreateBrush()
|
||||
{
|
||||
_bitmap = new WriteableBitmap(10, 10, 96, 96, PixelFormats.Bgra32, null);
|
||||
_bitmap = new WriteableBitmap(100, 100, 96, 96, PixelFormats.Bgra32, null);
|
||||
Brush = new ImageBrush(_bitmap) { Stretch = Stretch.UniformToFill };
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user