瀏覽代碼

Clamped opacity bindable

flabbet 2 年之前
父節點
當前提交
4d84a4e4fd
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/PixiEditor/ViewModels/SubViewModels/Document/StructureMemberViewModel.cs

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

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