0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-23 15:26:29 -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
[objects shape object-id]
(if (some? shape)
(let [shape-id (dm/get-prop shape :id)
fonts (ff/shape->fonts shape objects)
(let [fonts (ff/shape->fonts shape objects)
bounds (if (:show-content 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))
bounds (gsb/get-object-bounds objects shape)
x (dm/get-prop bounds :x)
y (dm/get-prop bounds :y)

View file

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

View file

@ -9,8 +9,7 @@
[app.common.data :as d]
[app.common.data.macros :as dm]
[app.common.files.helpers :as cfh]
[app.common.geom.rect :as grc]
[app.common.geom.shapes :as gsh]
[app.common.geom.shapes.bounds :as gsb]
[app.common.math :as mth]
[app.common.thumbnails :as thc]
[app.main.data.workspace.state-helpers :as wsh]
@ -98,12 +97,7 @@
container-ref (mf/use-ref nil)
content-ref (mf/use-ref nil)
;; FIXME: apply specific rendering optimizations separating to a component
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))
bounds (gsb/get-object-bounds objects shape)
x (dm/get-prop bounds :x)
y (dm/get-prop bounds :y)
@ -156,7 +150,7 @@
(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
{:id (dm/str "frame-container-" frame-id)
:key "frame-container"