Merge pull request #4159 from penpot/alotor-bugfix-viewer

Alotor bugfix viewer
This commit is contained in:
Aitor Moreno 2024-02-19 17:46:50 +01:00 committed by GitHub
commit 69ab02fc45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 54 additions and 47 deletions

View file

@ -74,9 +74,11 @@
(assoc-in [:viewer-local :interactions-show?] interactions-show?)))
ptk/WatchEvent
(watch [_ _ _]
(watch [_ state _]
(rx/of (fetch-bundle (d/without-nils params))
(fetch-comment-threads params)))
;; Only fetch threads for logged-in users
(when (some? (:profile state))
(fetch-comment-threads params))))
ptk/EffectEvent
(effect [_ _ _]

View file

@ -208,7 +208,10 @@
from-frame-id (if (cfh/frame-shape? from-shape)
from-id (:frame-id from-shape))
target-frame (ctst/get-frame-by-position objects position)]
target-frame
(->> (ctst/get-frames-by-position objects position)
(remove :hide-in-viewer)
(last))]
(when (and (not= (:id target-frame) uuid/zero)
(not= (:id target-frame) from-frame-id))

View file

@ -449,7 +449,7 @@
(assoc :fills []))
{:keys [width height] :as bounds} (gsb/get-object-bounds objects object)
{:keys [width height] :as bounds} (gsb/get-object-bounds objects object {:ignore-margin? false})
vbox (format-viewbox bounds)
fonts (ff/shape->fonts object objects)

View file

@ -47,7 +47,7 @@
:center (/ (:stroke-width stroke 0) 2)
:outer (:stroke-width stroke 0)
0)
margin (gsb/shape-stroke-margin stroke stroke-width)
stroke-margin (gsb/shape-stroke-margin shape stroke-width)
;; NOTE: for performance reasons we may can delimit a bit the
;; dependencies to really useful shape attrs instead of using
@ -57,8 +57,6 @@
(gst/shape->rect shape)
(grc/points->rect (:points shape))))
stroke-margin (+ stroke-width margin)
x (- (dm/get-prop selrect :x) stroke-margin)
y (- (dm/get-prop selrect :y) stroke-margin)
w (+ (dm/get-prop selrect :width) (* 2 stroke-margin))