mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-23 15:34:06 +00:00
brush widget UI: don't allow 0 width or height
This commit is contained in:
parent
56939ce01a
commit
7bb28f8c96
|
@ -122,13 +122,16 @@ widgetUpdate widget mode ( oldPt, newPt ) ( MkR oldFlds ) =
|
|||
| ℝ3 w h θ <- oldFlds
|
||||
-> case mode of
|
||||
ScaleAction whatScale ->
|
||||
let T ( ℝ2 w' h' ) = rotate ( cos -θ ) ( sin -θ ) newPt
|
||||
let T ( ℝ2 w0 h0 ) = rotate ( cos -θ ) ( sin -θ ) newPt
|
||||
-- Don't allow width/height to become 0.
|
||||
w' = max 1e-6 ( abs w0 )
|
||||
h' = max 1e-6 ( abs h0 )
|
||||
in case whatScale of
|
||||
ScaleXY -> MkR $ ℝ3 ( abs w' ) ( abs h' ) θ
|
||||
ScaleX -> MkR $ ℝ3 ( abs w' ) h θ
|
||||
ScaleY -> MkR $ ℝ3 w ( abs h' ) θ
|
||||
ScaleXY -> MkR $ ℝ3 w' h' θ
|
||||
ScaleX -> MkR $ ℝ3 w' h θ
|
||||
ScaleY -> MkR $ ℝ3 w h' θ
|
||||
RotateAction {}
|
||||
| norm newPt < 1e-5
|
||||
| norm newPt < 1e-6
|
||||
-> MkR oldFlds
|
||||
| otherwise
|
||||
->
|
||||
|
|
Loading…
Reference in a new issue