mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
🐛 Fix issue when scaling to value 0
This commit is contained in:
parent
c9c2f9e40f
commit
9cb6e71258
3 changed files with 9 additions and 2 deletions
|
@ -9,6 +9,7 @@
|
|||
- Fix overlay closed on clicked outside [Taiga #4027](https://tree.taiga.io/project/penpot/issue/4027)
|
||||
- Fix animate multiple overlays [Taiga #3993](https://tree.taiga.io/project/penpot/issue/3993)
|
||||
- Fix problem with snap to grids [#2221](https://github.com/penpot/penpot/issues/2221)
|
||||
- Fix issue when scaling to value 0 [Taiga #4109](https://tree.taiga.io/project/penpot/issue/4109)
|
||||
|
||||
## 1.15.3-beta
|
||||
|
||||
|
|
|
@ -317,9 +317,14 @@
|
|||
(unit)
|
||||
(scale value))))
|
||||
|
||||
(defn no-zeros
|
||||
"Remove zero values from either coordinate"
|
||||
[point]
|
||||
(-> point
|
||||
(update :x #(if (mth/almost-zero? %) 0.001 %))
|
||||
(update :y #(if (mth/almost-zero? %) 0.001 %))))
|
||||
|
||||
;; --- Debug
|
||||
|
||||
(defmethod pp/simple-dispatch Point [obj] (pr obj))
|
||||
|
||||
|
||||
|
|
|
@ -463,7 +463,8 @@
|
|||
(gpt/multiply handler-mult))
|
||||
|
||||
;; Resize vector
|
||||
scalev (gpt/divide (gpt/add shapev deltav) shapev)
|
||||
scalev (-> (gpt/divide (gpt/add shapev deltav) shapev)
|
||||
(gpt/no-zeros))
|
||||
|
||||
scalev (if lock?
|
||||
(let [v (cond
|
||||
|
|
Loading…
Reference in a new issue