mirror of
https://github.com/penpot/penpot.git
synced 2026-05-31 20:58:08 +00:00
🐛 Fix problem when resizing layout to zero size
This commit is contained in:
parent
da60911d81
commit
3fe5cd3752
@ -363,10 +363,10 @@
|
|||||||
c2 (+ (* a2 (:x c)) (* b2 (:y c)))
|
c2 (+ (* a2 (:x c)) (* b2 (:y c)))
|
||||||
|
|
||||||
;; Cramer's rule
|
;; Cramer's rule
|
||||||
det (- (* a1 b2) (* a2 b1))]
|
det (- (* a1 b2) (* a2 b1))
|
||||||
|
det (if (mth/almost-zero? det) 0.001 det)
|
||||||
|
|
||||||
;; If almost zero the lines are parallel
|
x (/ (- (* b2 c1) (* b1 c2)) det)
|
||||||
(when (not (mth/almost-zero? det))
|
y (/ (- (* c2 a1) (* c1 a2)) det)]
|
||||||
(let [x (/ (- (* b2 c1) (* b1 c2)) det)
|
|
||||||
y (/ (- (* c2 a1) (* c1 a2)) det)]
|
(gpt/point x y)))
|
||||||
(gpt/point x y)))))
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user