Editor - Always update layer shape on UI thread

This commit is contained in:
Robert Beekman committed 2022-07-25 08:26:32 +02:00
1 parent a2ce3b9d9c
commit 1f528ce51e
1 file changed
+2 -1
@@ -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);