mirror of
https://github.com/penpot/penpot.git
synced 2026-05-01 22:28:15 +00:00
✨ Calculate selrect from points
This commit is contained in:
parent
36d2f72768
commit
415a3cad7b
@ -7,7 +7,9 @@
|
||||
(ns app.common.geom.shapes.points
|
||||
(:require
|
||||
[app.common.geom.point :as gpt]
|
||||
[app.common.geom.shapes.common :as gco]
|
||||
[app.common.geom.shapes.intersect :as gsi]
|
||||
[app.common.geom.shapes.rect :as gre]
|
||||
[app.common.math :as mth]))
|
||||
|
||||
(defn origin
|
||||
@ -134,3 +136,10 @@
|
||||
(defn merge-parent-coords-bounds
|
||||
[bounds parent-bounds]
|
||||
(parent-coords-bounds (flatten bounds) parent-bounds))
|
||||
|
||||
(defn points->selrect
|
||||
[points]
|
||||
(let [width (width-points points)
|
||||
height (height-points points)
|
||||
center (gco/center-points points)]
|
||||
(gre/center->selrect center width height)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user