mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 09:46:12 +02:00
🐛 Fix thumbnail not taking frame blending mode
This commit is contained in:
parent
6090cf6c68
commit
5f3c381f88
4 changed files with 22 additions and 26 deletions
|
@ -57,6 +57,7 @@
|
||||||
- Fix scroll jumps in handoff mode [Taiga #2383](https://tree.taiga.io/project/penpot/issue/2383)
|
- Fix scroll jumps in handoff mode [Taiga #2383](https://tree.taiga.io/project/penpot/issue/2383)
|
||||||
- Fix handoff text with opacity [Taiga #2384](https://tree.taiga.io/project/penpot/issue/2384)
|
- Fix handoff text with opacity [Taiga #2384](https://tree.taiga.io/project/penpot/issue/2384)
|
||||||
- Restored rules color [Taiga #2460](https://tree.taiga.io/project/penpot/issue/2460)
|
- Restored rules color [Taiga #2460](https://tree.taiga.io/project/penpot/issue/2460)
|
||||||
|
- Fix thumbnail not taking frame blending mode [Taiga #2301](https://tree.taiga.io/project/penpot/issue/2301)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|
|
@ -195,14 +195,9 @@
|
||||||
(let [frame? (= (:type item) :frame)]
|
(let [frame? (= (:type item) :frame)]
|
||||||
(cond
|
(cond
|
||||||
(and frame? thumbnails? (some? (:thumbnail item)))
|
(and frame? thumbnails? (some? (:thumbnail item)))
|
||||||
[:image {:xlinkHref (:thumbnail item)
|
[:> shape-container {:shape item}
|
||||||
:x (:x item)
|
[:& frame/frame-thumbnail {:shape item}]]
|
||||||
:y (:y item)
|
|
||||||
:width (:width item)
|
|
||||||
:height (:height item)
|
|
||||||
;; DEBUG
|
|
||||||
:style {:filter (when (debug? :thumbnails) "sepia(1)")}
|
|
||||||
}]
|
|
||||||
frame?
|
frame?
|
||||||
[:& frame-wrapper {:shape item
|
[:& frame-wrapper {:shape item
|
||||||
:key (:id item)}]
|
:key (:id item)}]
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.main.ui.shapes.attrs :as attrs]
|
[app.main.ui.shapes.attrs :as attrs]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
|
[debug :refer [debug?]]
|
||||||
[rumext.alpha :as mf]))
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
(defn frame-clip-id
|
(defn frame-clip-id
|
||||||
|
@ -26,6 +27,21 @@
|
||||||
[:clipPath {:id (frame-clip-id shape render-id) :class "frame-clip"}
|
[:clipPath {:id (frame-clip-id shape render-id) :class "frame-clip"}
|
||||||
[:rect {:x x :y y :width width :height height}]])))
|
[: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
|
(defn frame-shape
|
||||||
[shape-wrapper]
|
[shape-wrapper]
|
||||||
(mf/fnc frame-shape
|
(mf/fnc frame-shape
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.core :as rx]
|
[beicon.core :as rx]
|
||||||
[debug :refer [debug?]]
|
|
||||||
[rumext.alpha :as mf]))
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
(defn check-frame-props
|
(defn check-frame-props
|
||||||
|
@ -36,27 +35,12 @@
|
||||||
(= new-thumbnail? old-thumbnail?)
|
(= new-thumbnail? old-thumbnail?)
|
||||||
(= new-children old-children))))
|
(= new-children old-children))))
|
||||||
|
|
||||||
(mf/defc 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)")}}])))
|
|
||||||
|
|
||||||
(mf/defc frame-placeholder
|
(mf/defc frame-placeholder
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[props]
|
[props]
|
||||||
(let [{:keys [x y width height fill-color] :as shape} (obj/get props "shape")]
|
(let [{:keys [x y width height fill-color] :as shape} (obj/get props "shape")]
|
||||||
(if (some? (:thumbnail shape))
|
(if (some? (:thumbnail shape))
|
||||||
[:& thumbnail {:shape shape}]
|
[:& frame/frame-thumbnail {:shape shape}]
|
||||||
[:rect {:x x :y y :width width :height height :style {:fill (or fill-color "var(--color-white)")}}])))
|
[:rect {:x x :y y :width width :height height :style {:fill (or fill-color "var(--color-white)")}}])))
|
||||||
|
|
||||||
(defn custom-deferred
|
(defn custom-deferred
|
||||||
|
@ -128,7 +112,7 @@
|
||||||
[:> shape-container {:shape shape}
|
[:> shape-container {:shape shape}
|
||||||
[:& ff/fontfaces-style {:shapes all-children}]
|
[:& ff/fontfaces-style {:shapes all-children}]
|
||||||
(if show-thumbnail?
|
(if show-thumbnail?
|
||||||
[:& thumbnail {:shape shape}]
|
[:& frame/frame-thumbnail {:shape shape}]
|
||||||
[:& deferred-frame-shape
|
[:& deferred-frame-shape
|
||||||
{:shape shape
|
{:shape shape
|
||||||
:childs children}])]])))))
|
:childs children}])]])))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue