소스 검색

Added position on canvas

Krzysztof Krysiński 2 주 전
부모
커밋
3f696f4e5d
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/PointerInfoNode.cs

+ 3 - 0
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/PointerInfoNode.cs

@@ -7,6 +7,7 @@ namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
 [NodeInfo("PointerInfo")]
 public class PointerInfoNode : Node
 {
+    public OutputProperty<VecD> PositionOnCanvas { get; }
     public OutputProperty<double> Pressure { get; }
     public OutputProperty<double> Twist { get; }
     public OutputProperty<VecD> Tilt { get; }
@@ -15,6 +16,7 @@ public class PointerInfoNode : Node
 
     public PointerInfoNode()
     {
+        PositionOnCanvas = CreateOutput<VecD>("PositionOnCanvas", "POSITION_ON_CANVAS", new VecD(0, 0));
         Pressure = CreateOutput<double>("Pressure", "PRESSURE", 1.0);
         Twist = CreateOutput<double>("Twist", "TWIST", 0.0);
         Tilt = CreateOutput<VecD>("Tilt", "TILT", new VecD(0, 0));
@@ -29,6 +31,7 @@ public class PointerInfoNode : Node
             return;
         }
 
+        PositionOnCanvas.Value = context.PointerInfo.PositionOnCanvas;
         Pressure.Value = context.PointerInfo.Pressure;
         Twist.Value = context.PointerInfo.Twist;
         Tilt.Value = context.PointerInfo.Tilt;