mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-05 06:43:37 +00:00
fix brush rotation widget
This commit is contained in:
parent
a41c6235ae
commit
3d36b39541
|
@ -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
|
||||
|
|
|
@ -110,8 +110,6 @@ import MetaBrush.Unique
|
|||
import MetaBrush.GTK.Util
|
||||
( withRGBA )
|
||||
|
||||
import Debug.Trace
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
data Renders a
|
||||
|
|
|
@ -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
|
||||
coords $
|
||||
if anchorIsAtEnd
|
||||
then splineEnd ( adjustSplineType @Open strokeSpline )
|
||||
else splineStart ( adjustSplineType @Open strokeSpline )
|
||||
|
||||
addToAnchor :: DrawAnchor -> Spline Open () ( PointData () ) -> Document -> Document
|
||||
addToAnchor anchor newSpline doc@( Document { documentMetadata, documentContent = oldContent } ) =
|
||||
|
|
Loading…
Reference in a new issue