Browse Source

Clamped opacity bindable

flabbet 2 years ago
parent
commit
4d84a4e4fd

+ 2 - 1
src/PixiEditor/ViewModels/SubViewModels/Document/StructureMemberViewModel.cs

@@ -128,8 +128,9 @@ internal abstract class StructureMemberViewModel : INotifyPropertyChanged
         {
         {
             if (Document.UpdateableChangeActive)
             if (Document.UpdateableChangeActive)
                 return;
                 return;
+            float newValue = Math.Clamp(value, 0, 1);
             Internals.ActionAccumulator.AddFinishedActions(
             Internals.ActionAccumulator.AddFinishedActions(
-                new StructureMemberOpacity_Action(GuidValue, value),
+                new StructureMemberOpacity_Action(GuidValue, newValue),
                 new EndStructureMemberOpacity_Action());
                 new EndStructureMemberOpacity_Action());
         }
         }
     }
     }