Browse Source

Fixed blob on start of stroke X11

flabbet 3 days ago
parent
commit
929a24c015

+ 3 - 1
src/PixiEditor/Models/DocumentModels/ChangeExecutionController.cs

@@ -243,7 +243,9 @@ internal class ChangeExecutionController
         LeftMousePressed = true;
         LeftMousePressed = true;
         RightMousePressed = args.Properties.IsRightButtonPressed;
         RightMousePressed = args.Properties.IsRightButtonPressed;
 
 
-        lastPointerInfo = ConstructPointerInfo(args.Point.PositionOnCanvas, args);
+        // Some drivers do not report pressure for pointer down events. For example it happens on X11. We set pressure to 0, so Brush Engine does not
+        // draw a blob with 0.5 pressure on each start of stroke.
+        lastPointerInfo = ConstructPointerInfo(args.Point.PositionOnCanvas, args) with { Pressure = 0 }; 
         if (_queuedExecutor != null && currentSession == null)
         if (_queuedExecutor != null && currentSession == null)
         {
         {
             StartExecutor(_queuedExecutor);
             StartExecutor(_queuedExecutor);