From b0a17c80ec9971a323502e2cb2305fd7ccf3266a Mon Sep 17 00:00:00 2001 From: sheaf Date: Sun, 20 Oct 2024 10:27:29 +0200 Subject: [PATCH] allow brush widget to modify different strokes --- src/metabrushes/MetaBrush/Action.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/metabrushes/MetaBrush/Action.hs b/src/metabrushes/MetaBrush/Action.hs index 2a37cd1..7f80e05 100644 --- a/src/metabrushes/MetaBrush/Action.hs +++ b/src/metabrushes/MetaBrush/Action.hs @@ -974,9 +974,6 @@ applyBrushWidgetAction pressingCtrl pressingAlt c mbPrevAction doc@( Document { ( StrokeMetadata { strokeVisible, strokeLocked } ) | strokeVisible , not strokeLocked - -- If we have already started a widget action, only continue an action - -- for the stroke with the correct unique. - , case mbPrevAction of { Just ( ABrushWidgetActionState act ) -> brushWidgetStrokeUnique act == u; Nothing -> True } -- Don't touch strokes without brushes. , Just ( brush@( NamedBrush {} ) :: NamedBrush brushFields ) <- strokeBrush , Intersection { inject2 = updateBrushParams, project1 = ptParamsToUsedParams } @@ -1108,13 +1105,16 @@ applyBrushWidgetAction pressingCtrl pressingAlt c mbPrevAction doc@( Document { Just ( ABrushWidgetActionState @brushFields' prevAction@( BrushWidgetActionState { brushWidgetPointBeingMoved = oldPt + , brushWidgetStrokeUnique = actionUniq , brushWidgetPointIndex = j' , brushWidgetAction = act } ) ) -> if | Just Refl <- eqT @brushFields @brushFields' + , uniq == actionUniq , j == j' -- Continue the current brush widget action, - -- at the point with the correct index in the stroke. + -- but only for the right stroke and only at the point with + -- the correct index within the stroke. -> do let newPt = pointCoords pt --> c