0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-23 23:35:58 -05:00

🐛 Fix cropped imposters

This commit is contained in:
Aitor 2023-11-30 15:23:11 +01:00 committed by Andrey Antukh
parent 4e87341c1e
commit f7c616206a
3 changed files with 8 additions and 19 deletions

View file

@ -534,14 +534,9 @@
(defn render-frame (defn render-frame
[objects shape object-id] [objects shape object-id]
(if (some? shape) (if (some? shape)
(let [shape-id (dm/get-prop shape :id) (let [fonts (ff/shape->fonts shape objects)
fonts (ff/shape->fonts shape objects)
bounds (if (:show-content shape) bounds (gsb/get-object-bounds objects shape)
(let [ids (cfh/get-children-ids objects shape-id)
children (sequence (keep (d/getf objects)) ids)]
(gsh/shapes->rect (cons shape children)))
(-> shape :points grc/points->rect))
x (dm/get-prop bounds :x) x (dm/get-prop bounds :x)
y (dm/get-prop bounds :y) y (dm/get-prop bounds :y)

View file

@ -79,9 +79,9 @@
filter-str filter-str
(when (and (or (cfh/group-shape? shape) (when (and (or (cfh/group-shape? shape)
(cfh/frame-shape? shape) (cfh/frame-shape? shape)
(cfh/svg-raw-shape? shape)) (cfh/svg-raw-shape? shape))
(not disable-shadows?)) (not disable-shadows?))
(filters/filter-str filter-id shape)) (filters/filter-str filter-id shape))
wrapper-props wrapper-props

View file

@ -9,8 +9,7 @@
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.common.files.helpers :as cfh] [app.common.files.helpers :as cfh]
[app.common.geom.rect :as grc] [app.common.geom.shapes.bounds :as gsb]
[app.common.geom.shapes :as gsh]
[app.common.math :as mth] [app.common.math :as mth]
[app.common.thumbnails :as thc] [app.common.thumbnails :as thc]
[app.main.data.workspace.state-helpers :as wsh] [app.main.data.workspace.state-helpers :as wsh]
@ -98,12 +97,7 @@
container-ref (mf/use-ref nil) container-ref (mf/use-ref nil)
content-ref (mf/use-ref nil) content-ref (mf/use-ref nil)
;; FIXME: apply specific rendering optimizations separating to a component bounds (gsb/get-object-bounds objects shape)
bounds (if (:show-content shape)
(let [ids (cfh/get-children-ids objects frame-id)
children (sequence (keep (d/getf objects)) ids)]
(gsh/shapes->rect (cons shape children)))
(-> shape :points grc/points->rect))
x (dm/get-prop bounds :x) x (dm/get-prop bounds :x)
y (dm/get-prop bounds :y) y (dm/get-prop bounds :y)
@ -156,7 +150,7 @@
(fdm/use-dynamic-modifiers objects (mf/ref-val content-ref) modifiers) (fdm/use-dynamic-modifiers objects (mf/ref-val content-ref) modifiers)
[:& shape-container {:shape shape} [:& shape-container {:shape shape :disable-shadows? thumbnail?}
[:g.frame-container [:g.frame-container
{:id (dm/str "frame-container-" frame-id) {:id (dm/str "frame-container-" frame-id)
:key "frame-container" :key "frame-container"