Draw fills offscreen to support blend mode when multiple fills

This commit is contained in:
Belén Albeza 2024-11-14 16:21:51 +01:00
parent 3eb24e7f5f
commit 263d7eb313
3 changed files with 64 additions and 38 deletions

View file

@ -79,23 +79,23 @@
;; These values correspond to skia::BlendMode representation
;; https://rust-skia.github.io/doc/skia_safe/enum.BlendMode.html
(let [encoded-blend (case blend-mode
:normal 3
:darken 16
:multiply 24
:color-burn 19
:lighten 17
:screen 14
:color-dodge 18
:overlay 15
:soft-light 21
:hard-light 20
:difference 22
:exclusion 23
:hue 25
:saturation 26
:color 27
:luminosity 28
3)]
:normal 3
:darken 16
:multiply 24
:color-burn 19
:lighten 17
:screen 14
:color-dodge 18
:overlay 15
:soft-light 21
:hard-light 20
:difference 22
:exclusion 23
:hue 25
:saturation 26
:color 27
:luminosity 28
3)]
(._set_shape_blend_mode ^js internal-module encoded-blend)))
(defn set-objects