allow brush widget to modify different strokes

This commit is contained in:
sheaf 2024-10-20 10:27:29 +02:00
parent 3fe46fc029
commit b0a17c80ec

View file

@ -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