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

Editor - Always update layer shape on UI thread

This commit is contained in:
Robert Beekman 2022-07-25 08:26:32 +02:00
parent a2ce3b9d9c
commit 1f528ce51e

View File

@ -8,6 +8,7 @@ using Avalonia;
using Avalonia.Controls.Mixins; using Avalonia.Controls.Mixins;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Skia; using Avalonia.Skia;
using Avalonia.Threading;
using ReactiveUI; using ReactiveUI;
using SkiaSharp; using SkiaSharp;
@ -27,7 +28,7 @@ public class LayerShapeVisualizerViewModel : ActivatableViewModelBase, IVisualiz
this.WhenActivated(d => this.WhenActivated(d =>
{ {
Observable.FromEventPattern(x => Layer.RenderPropertiesUpdated += x, x => Layer.RenderPropertiesUpdated -= x).Subscribe(_ => Update()).DisposeWith(d); Observable.FromEventPattern(x => Layer.RenderPropertiesUpdated += x, x => Layer.RenderPropertiesUpdated -= x).Subscribe(_ => Dispatcher.UIThread.Post(Update)).DisposeWith(d);
Observable.FromEventPattern<LayerPropertyEventArgs>(x => Layer.Transform.Position.CurrentValueSet += x, x => Layer.Transform.Position.CurrentValueSet -= x) Observable.FromEventPattern<LayerPropertyEventArgs>(x => Layer.Transform.Position.CurrentValueSet += x, x => Layer.Transform.Position.CurrentValueSet -= x)
.Subscribe(_ => UpdateTransform()) .Subscribe(_ => UpdateTransform())
.DisposeWith(d); .DisposeWith(d);