fix brush rotation widget

This commit is contained in:
sheaf 2024-09-28 11:17:33 +02:00
parent a41c6235ae
commit 3d36b39541
3 changed files with 6 additions and 12 deletions

View file

@ -825,9 +825,9 @@ instance HandleAction MouseMove where
case applyBrushWidgetAction ( pressingControl modifiers ) pos ( Just brushAction ) doc of
Nothing ->
pure Don'tModifyDoc
Just ( newDocument, _ ) -> do
Just ( newDocument, brushAction' ) -> do
STM.writeTVar mouseHoldTVar ( Just $ BrushWidgetAction pos brushAction' )
-- This is just for preview, so TrivialDiff.
STM.writeTVar mouseHoldTVar ( Just $ BrushWidgetAction pos brushAction )
pure ( UpdateDoc $ UpdateDocumentTo newDocument TrivialDiff )
_ -> pure Don'tModifyDoc
| otherwise

View file

@ -110,8 +110,6 @@ import MetaBrush.Unique
import MetaBrush.GTK.Util
( withRGBA )
import Debug.Trace
--------------------------------------------------------------------------------
data Renders a

View file

@ -70,8 +70,6 @@ import MetaBrush.Stroke
import MetaBrush.Unique
( Unique, UniqueSupply, freshUnique )
import Debug.Trace
--------------------------------------------------------------------------------
-- | A draw anchor, to continue drawing from one end of an existing stroke.
@ -209,12 +207,10 @@ anchorPos ( DrawAnchor { anchorStroke, anchorIsAtEnd } )
case Map.lookup anchorStroke strokes of
Nothing -> error "draw anchor: stroke not present in hierarchy"
Just ( Stroke { strokeSpline } ) ->
let res =
coords $
if anchorIsAtEnd
then splineEnd ( adjustSplineType @Open strokeSpline )
else splineStart ( adjustSplineType @Open strokeSpline )
in trace ("anchorPos: " ++ show res) res
addToAnchor :: DrawAnchor -> Spline Open () ( PointData () ) -> Document -> Document
addToAnchor anchor newSpline doc@( Document { documentMetadata, documentContent = oldContent } ) =