diff --git a/frontend/src/app/main/ui/shapes/frame.cljs b/frontend/src/app/main/ui/shapes/frame.cljs index 0d371ce49..91425cd79 100644 --- a/frontend/src/app/main/ui/shapes/frame.cljs +++ b/frontend/src/app/main/ui/shapes/frame.cljs @@ -45,15 +45,32 @@ [props] (let [shape (obj/get props "shape")] (when (:thumbnail shape) - [:image.frame-thumbnail - {:id (dm/str "thumbnail-" (:id shape)) - :xlinkHref (:thumbnail shape) - :x (:x shape) - :y (:y shape) - :width (:width shape) - :height (:height shape) - ;; DEBUG - :style {:filter (when (debug? :thumbnails) "sepia(1)")}}]))) + (let [{:keys [x y width height]} shape + transform (gsh/transform-matrix shape) + props (-> (attrs/extract-style-attrs shape) + (obj/merge! + #js {:x x + :y y + :transform (str transform) + :width width + :height height + :className "frame-background"})) + path? (some? (.-d props))] + [:* + [:image.frame-thumbnail + {:id (dm/str "thumbnail-" (:id shape)) + :xlinkHref (:thumbnail shape) + :x (:x shape) + :y (:y shape) + :width (:width shape) + :height (:height shape) + ;; DEBUG + :style {:filter (when (debug? :thumbnails) "sepia(1)")}}] + + [:& shape-strokes {:shape shape} + (if path? + [:> :path props] + [:> :rect props])]])))) (defn frame-shape [shape-wrapper] @@ -88,8 +105,9 @@ (for [item childs] [:& shape-wrapper {:shape item :key (dm/str (:id item))}]) - [:& shape-strokes {:shape shape} - (if path? - [:> :path props] - [:> :rect props])]]]]))) + ]] + [:& shape-strokes {:shape shape} + (if path? + [:> :path props] + [:> :rect props])]])))