🐛 Fix problem with thumbnails in safari

This commit is contained in:
alonso.torres 2023-02-02 11:31:10 +01:00
parent fe76e0fab6
commit e47ce3235e
2 changed files with 6 additions and 5 deletions

View file

@ -54,11 +54,11 @@
(defn width-points (defn width-points
[[p0 p1 _ _]] [[p0 p1 _ _]]
(gpt/length (gpt/to-vec p0 p1))) (max 0.01 (gpt/length (gpt/to-vec p0 p1))))
(defn height-points (defn height-points
[[p0 _ _ p3]] [[p0 _ _ p3]]
(gpt/length (gpt/to-vec p0 p3))) (max 0.01 (gpt/length (gpt/to-vec p0 p3))))
(defn pad-points (defn pad-points
[[p0 p1 p2 p3 :as points] pad-top pad-right pad-bottom pad-left] [[p0 p1 p2 p3 :as points] pad-top pad-right pad-bottom pad-left]

View file

@ -110,7 +110,9 @@
(let [canvas-node (mf/ref-val frame-canvas-ref) (let [canvas-node (mf/ref-val frame-canvas-ref)
img-node (mf/ref-val frame-image-ref)] img-node (mf/ref-val frame-image-ref)]
(when (draw-thumbnail-canvas! canvas-node img-node) (when (draw-thumbnail-canvas! canvas-node img-node)
(reset! image-url nil) (when-not (cf/check-browser? :safari)
(reset! image-url nil))
(when @show-frame-thumbnail (when @show-frame-thumbnail
(reset! show-frame-thumbnail false)) (reset! show-frame-thumbnail false))
;; If we don't have the thumbnail data saved (normally the first load) we update the data ;; If we don't have the thumbnail data saved (normally the first load) we update the data
@ -272,8 +274,7 @@
:height fixed-height :height fixed-height
;; DEBUG ;; DEBUG
:style {:filter (when (and (not (cf/check-browser? :safari)) (debug? :thumbnails)) "invert(1)") :style {:filter (when (and (not (cf/check-browser? :safari)) (debug? :thumbnails)) "invert(1)")
:width "100%" :display (when (cf/check-browser? :safari) "none")}}]]
:height "100%"}}]]
;; Safari don't support filters so instead we add a rectangle around the thumbnail ;; Safari don't support filters so instead we add a rectangle around the thumbnail
(when (and (cf/check-browser? :safari) (debug? :thumbnails)) (when (and (cf/check-browser? :safari) (debug? :thumbnails))