🐛 Fix thumbnail not taking frame blending mode

This commit is contained in:
alonso.torres 2022-01-13 15:56:01 +01:00
parent 6090cf6c68
commit 5f3c381f88
4 changed files with 22 additions and 26 deletions

View file

@ -8,6 +8,7 @@
(:require
[app.main.ui.shapes.attrs :as attrs]
[app.util.object :as obj]
[debug :refer [debug?]]
[rumext.alpha :as mf]))
(defn frame-clip-id
@ -26,6 +27,21 @@
[:clipPath {:id (frame-clip-id shape render-id) :class "frame-clip"}
[:rect {:x x :y y :width width :height height}]])))
(mf/defc frame-thumbnail
{::mf/wrap-props false}
[props]
(let [shape (obj/get props "shape")]
(when (:thumbnail shape)
[:image.frame-thumbnail
{:id (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)")}}])))
(defn frame-shape
[shape-wrapper]
(mf/fnc frame-shape