mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 01:01:37 +02:00
⚡ Use the function hypot
for distances
This commit is contained in:
parent
84e9f69213
commit
10439934d4
4 changed files with 12 additions and 8 deletions
|
@ -890,8 +890,7 @@
|
|||
(defn calculate-ratio
|
||||
;; sqrt((actual-width)**2 + (actual-height)**2)/sqrt(2).
|
||||
[width height]
|
||||
(/ (mth/sqrt (+ (mth/pow width 2)
|
||||
(mth/pow height 2)))
|
||||
(/ (mth/hypot width height)
|
||||
(mth/sqrt 2)))
|
||||
|
||||
(defn fix-percents
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue