mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-27 09:24:08 +00:00
don't deselect selection after brush widget update
This commit is contained in:
parent
5adcb34de6
commit
3fe46fc029
|
@ -1022,7 +1022,8 @@ instance HandleAction MouseClick where
|
||||||
then pure Don'tModifyDoc
|
then pure Don'tModifyDoc
|
||||||
else do
|
else do
|
||||||
-- Clicked on an unselected point: only select that point.
|
-- Clicked on an unselected point: only select that point.
|
||||||
let newDoc = set ( field' @"documentMetadata" . field' @"selectedPoints" )
|
let newDoc =
|
||||||
|
set ( field' @"documentMetadata" . field' @"selectedPoints" )
|
||||||
( StrokePoints $ Map.singleton u ( Set.singleton i ) )
|
( StrokePoints $ Map.singleton u ( Set.singleton i ) )
|
||||||
doc
|
doc
|
||||||
pure ( UpdateDoc $ UpdateDocumentTo newDoc TrivialDiff )
|
pure ( UpdateDoc $ UpdateDocumentTo newDoc TrivialDiff )
|
||||||
|
@ -1211,8 +1212,13 @@ instance HandleAction MouseRelease where
|
||||||
Just hold
|
Just hold
|
||||||
| PathMode <- mode
|
| PathMode <- mode
|
||||||
, DragMoveHold { holdStartPos = pos0, dragAction } <- hold
|
, DragMoveHold { holdStartPos = pos0, dragAction } <- hold
|
||||||
, not $ inPointClickRange zoom pos0 pos
|
->
|
||||||
-> let
|
if inPointClickRange zoom pos0 pos
|
||||||
|
then
|
||||||
|
let mbDoc' = fst <$> selectAt selMode pos doc
|
||||||
|
in pure ( UpdateDoc $ UpdateDocumentTo ( fromMaybe doc mbDoc' ) TrivialDiff )
|
||||||
|
else
|
||||||
|
let
|
||||||
alternateMode :: Bool
|
alternateMode :: Bool
|
||||||
alternateMode = any ( \case { Alt _ -> True; _ -> False } ) modifiers
|
alternateMode = any ( \case { Alt _ -> True; _ -> False } ) modifiers
|
||||||
in case dragUpdate pos0 pos dragAction alternateMode doc of
|
in case dragUpdate pos0 pos dragAction alternateMode doc of
|
||||||
|
@ -1226,12 +1232,17 @@ instance HandleAction MouseRelease where
|
||||||
in pure $ UpdateDoc ( UpdateDocumentTo doc' diff )
|
in pure $ UpdateDoc ( UpdateDocumentTo doc' diff )
|
||||||
Nothing -> pure Don'tModifyDoc
|
Nothing -> pure Don'tModifyDoc
|
||||||
| SelectionHold pos0 <- hold
|
| SelectionHold pos0 <- hold
|
||||||
, not $ inPointClickRange zoom pos0 pos
|
-> let mbDoc'
|
||||||
, let mbDoc' = fst <$> selectRectangle selMode pos0 pos doc
|
| inPointClickRange zoom pos0 pos
|
||||||
-> pure ( UpdateDoc $ UpdateDocumentTo ( fromMaybe doc mbDoc' ) TrivialDiff )
|
= fst <$> selectAt selMode pos doc
|
||||||
_ ->
|
| otherwise
|
||||||
let mbDoc' = fst <$> selectAt selMode pos doc
|
= fst <$> selectRectangle selMode pos0 pos doc
|
||||||
in pure ( UpdateDoc $ UpdateDocumentTo ( fromMaybe doc mbDoc' ) TrivialDiff )
|
in pure ( UpdateDoc $ UpdateDocumentTo ( fromMaybe doc mbDoc' ) TrivialDiff )
|
||||||
|
| otherwise
|
||||||
|
-> pure Don'tModifyDoc
|
||||||
|
Nothing -> do
|
||||||
|
let mbDoc' = fst <$> selectAt selMode pos doc
|
||||||
|
pure ( UpdateDoc $ UpdateDocumentTo ( fromMaybe doc mbDoc' ) TrivialDiff )
|
||||||
|
|
||||||
Pen -> case mode of
|
Pen -> case mode of
|
||||||
PathMode -> do
|
PathMode -> do
|
||||||
|
|
Loading…
Reference in a new issue