mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 14:26:11 +02:00
🐛 Fix problem with plugins path positioning
This commit is contained in:
parent
aca3e3db4f
commit
1cda61e230
1 changed files with 12 additions and 8 deletions
|
@ -952,7 +952,7 @@
|
||||||
|
|
||||||
;; Geometry properties
|
;; Geometry properties
|
||||||
{:name "x"
|
{:name "x"
|
||||||
:get #(-> % u/proxy->shape :x)
|
:get #(-> % u/proxy->shape :points grc/points->rect :x)
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
|
@ -967,7 +967,7 @@
|
||||||
(st/emit! (dw/update-position id {:x value})))))}
|
(st/emit! (dw/update-position id {:x value})))))}
|
||||||
|
|
||||||
{:name "y"
|
{:name "y"
|
||||||
:get #(-> % u/proxy->shape :y)
|
:get #(-> % u/proxy->shape :points grc/points->rect :y)
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
|
@ -991,9 +991,10 @@
|
||||||
{:name "parentX"
|
{:name "parentX"
|
||||||
:get (fn [self]
|
:get (fn [self]
|
||||||
(let [shape (u/proxy->shape self)
|
(let [shape (u/proxy->shape self)
|
||||||
|
shape-x (-> shape :points grc/points->rect :x)
|
||||||
parent-id (:parent-id shape)
|
parent-id (:parent-id shape)
|
||||||
parent (u/locate-shape (obj/get self "$file") (obj/get self "$page") parent-id)]
|
parent (u/locate-shape (obj/get self "$file") (obj/get self "$page") parent-id)]
|
||||||
(- (:x shape) (:x parent))))
|
(- shape-x (:x parent))))
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(cond
|
(cond
|
||||||
|
@ -1013,10 +1014,11 @@
|
||||||
{:name "parentY"
|
{:name "parentY"
|
||||||
:get (fn [self]
|
:get (fn [self]
|
||||||
(let [shape (u/proxy->shape self)
|
(let [shape (u/proxy->shape self)
|
||||||
|
shape-y (-> shape :points grc/points->rect :y)
|
||||||
parent-id (:parent-id shape)
|
parent-id (:parent-id shape)
|
||||||
parent (u/locate-shape (obj/get self "$file") (obj/get self "$page") parent-id)
|
parent (u/locate-shape (obj/get self "$file") (obj/get self "$page") parent-id)
|
||||||
parent-y (:y parent)]
|
parent-y (:y parent)]
|
||||||
(- (:y shape) parent-y)))
|
(- shape-y parent-y)))
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(cond
|
(cond
|
||||||
|
@ -1036,10 +1038,11 @@
|
||||||
{:name "boardX"
|
{:name "boardX"
|
||||||
:get (fn [self]
|
:get (fn [self]
|
||||||
(let [shape (u/proxy->shape self)
|
(let [shape (u/proxy->shape self)
|
||||||
|
shape-x (-> shape :points grc/points->rect :x)
|
||||||
frame-id (:parent-id shape)
|
frame-id (:parent-id shape)
|
||||||
frame (u/locate-shape (obj/get self "$file") (obj/get self "$page") frame-id)
|
frame (u/locate-shape (obj/get self "$file") (obj/get self "$page") frame-id)
|
||||||
frame-x (:x frame)]
|
frame-x (:x frame)]
|
||||||
(- (:x shape) frame-x)))
|
(- shape-x frame-x)))
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(cond
|
(cond
|
||||||
|
@ -1059,10 +1062,11 @@
|
||||||
{:name "boardY"
|
{:name "boardY"
|
||||||
:get (fn [self]
|
:get (fn [self]
|
||||||
(let [shape (u/proxy->shape self)
|
(let [shape (u/proxy->shape self)
|
||||||
|
shape-y (-> shape :points grc/points->rect :y)
|
||||||
frame-id (:parent-id shape)
|
frame-id (:parent-id shape)
|
||||||
frame (u/locate-shape (obj/get self "$file") (obj/get self "$page") frame-id)
|
frame (u/locate-shape (obj/get self "$file") (obj/get self "$page") frame-id)
|
||||||
frame-y (:y frame)]
|
frame-y (:y frame)]
|
||||||
(- (:y shape) frame-y)))
|
(- shape-y frame-y)))
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(cond
|
(cond
|
||||||
|
@ -1080,10 +1084,10 @@
|
||||||
(st/emit! (dw/update-position id {:y (+ frame-y value)})))))}
|
(st/emit! (dw/update-position id {:y (+ frame-y value)})))))}
|
||||||
|
|
||||||
{:name "width"
|
{:name "width"
|
||||||
:get #(-> % u/proxy->shape :width)}
|
:get #(-> % u/proxy->shape :selrect :width)}
|
||||||
|
|
||||||
{:name "height"
|
{:name "height"
|
||||||
:get #(-> % u/proxy->shape :height)}
|
:get #(-> % u/proxy->shape :selrect :height)}
|
||||||
|
|
||||||
{:name "bounds"
|
{:name "bounds"
|
||||||
:get #(-> % u/proxy->shape :points grc/points->rect format/format-bounds)}
|
:get #(-> % u/proxy->shape :points grc/points->rect format/format-bounds)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue