diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 5973451a94..85b2b7f63f 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -26,7 +26,7 @@ [app.common.types.component :as ctk] [app.common.types.container :as ctn] [app.common.types.file :as ctf] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.types.path :as path] [app.common.types.path.segment :as path.segment] [app.common.types.shape :as cts] @@ -838,7 +838,7 @@ (d/update-when :components d/update-vals update-container)))) (def ^:private valid-fill? - (sm/lazy-validator types.fill/schema:fill)) + (sm/lazy-validator types.fills/schema:fill)) (defmethod migrate-data "legacy-43" [data _] @@ -1466,7 +1466,7 @@ (clear-fill [fill] (-> fill - (select-keys types.fill/fill-attrs) + (select-keys types.fills/fill-attrs) (d/update-when :fill-image clear-color-image) (d/update-when :fill-color-gradient clear-color-gradient))) diff --git a/common/src/app/common/types/fill.cljc b/common/src/app/common/types/fills.cljc similarity index 96% rename from common/src/app/common/types/fill.cljc rename to common/src/app/common/types/fills.cljc index 827b7e24fc..5a37cd3d91 100644 --- a/common/src/app/common/types/fill.cljc +++ b/common/src/app/common/types/fills.cljc @@ -4,11 +4,11 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns app.common.types.fill +(ns app.common.types.fills (:require [app.common.schema :as sm] [app.common.types.color :as types.color] - [app.common.types.fill.impl :as impl] + [app.common.types.fills.impl :as impl] [clojure.set :as set])) (def ^:const MAX-GRADIENT-STOPS impl/MAX-GRADIENT-STOPS) diff --git a/common/src/app/common/types/fill/impl.cljc b/common/src/app/common/types/fills/impl.cljc similarity index 99% rename from common/src/app/common/types/fill/impl.cljc rename to common/src/app/common/types/fills/impl.cljc index 5094e4b296..ed1781fc0e 100644 --- a/common/src/app/common/types/fill/impl.cljc +++ b/common/src/app/common/types/fills/impl.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns app.common.types.fill.impl +(ns app.common.types.fills.impl (:require #?(:clj [clojure.data.json :as json]) #?(:cljs [app.common.weak-map :as weak-map]) diff --git a/common/src/app/common/types/path.cljc b/common/src/app/common/types/path.cljc index bcfc69fbcb..0e5d7d1bc3 100644 --- a/common/src/app/common/types/path.cljc +++ b/common/src/app/common/types/path.cljc @@ -25,6 +25,7 @@ (def ^:cosnt bool-group-style-properties bool/group-style-properties) (def ^:const bool-style-properties bool/style-properties) + (def ^:const default-bool-fills bool/default-fills) (def schema:content impl/schema:content) diff --git a/common/src/app/common/types/shape.cljc b/common/src/app/common/types/shape.cljc index 9f3b055c2a..be0ac41836 100644 --- a/common/src/app/common/types/shape.cljc +++ b/common/src/app/common/types/shape.cljc @@ -21,7 +21,7 @@ [app.common.text :as txt] [app.common.transit :as t] [app.common.types.color :as types.color] - [app.common.types.fill :refer [schema:fill]] + [app.common.types.fills :refer [schema:fill]] [app.common.types.grid :as ctg] [app.common.types.path :as path] [app.common.types.path.segment :as path.segment] diff --git a/common/src/app/common/types/shape/text.cljc b/common/src/app/common/types/shape/text.cljc index 03dca9fb74..25c2c8e072 100644 --- a/common/src/app/common/types/shape/text.cljc +++ b/common/src/app/common/types/shape/text.cljc @@ -7,7 +7,7 @@ (ns app.common.types.shape.text (:require [app.common.schema :as sm] - [app.common.types.fill :refer [schema:fill]] + [app.common.types.fills :refer [schema:fill]] [app.common.types.shape :as-alias shape] [app.common.types.shape.text.position-data :as-alias position-data])) diff --git a/common/test/common_tests/logic/text_sync_test.cljc b/common/test/common_tests/logic/text_sync_test.cljc index 3f1fb18c68..77abc14a77 100644 --- a/common/test/common_tests/logic/text_sync_test.cljc +++ b/common/test/common_tests/logic/text_sync_test.cljc @@ -19,7 +19,7 @@ (t/use-fixtures :each thi/test-fixture) -(t/deftest test-sync-unchanged-copy-when-changed-attribute +(t/deftest sync-unchanged-copy-when-changed-attribute (let [;; ==== Setup file (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -55,7 +55,7 @@ (t/is (= "32" (:font-size line))) (t/is (= "hello world" (:text line))))) -(t/deftest test-sync-unchanged-copy-when-changed-text +(t/deftest sync-unchanged-copy-when-changed-text (let [;; ==== Setup file (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -91,7 +91,7 @@ (t/is (= "14" (:font-size line))) (t/is (= "Bye" (:text line))))) -(t/deftest test-sync-unchanged-copy-when-changed-both +(t/deftest sync-unchanged-copy-when-changed-both (let [;; ==== Setup file (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -129,7 +129,7 @@ (t/is (= "32" (:font-size line))) (t/is (= "Bye" (:text line))))) -(t/deftest test-sync-updated-attr-copy-when-changed-attribute +(t/deftest sync-updated-attr-copy-when-changed-attribute (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -176,7 +176,7 @@ (t/is (= "14" (:font-size line))) (t/is (= "hello world" (:text line))))) -(t/deftest test-sync-updated-attr-copy-when-changed-text +(t/deftest sync-updated-attr-copy-when-changed-text (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -223,7 +223,7 @@ ;; The text is updated because only attrs were touched (t/is (= "Bye" (:text line))))) -(t/deftest test-sync-updated-attr-copy-when-changed-both +(t/deftest sync-updated-attr-copy-when-changed-both (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -273,7 +273,7 @@ ;; The text is updated because only attrs were touched (t/is (= "Bye" (:text line))))) -(t/deftest test-sync-updated-text-copy-when-changed-attribute +(t/deftest sync-updated-text-copy-when-changed-attribute (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -320,7 +320,7 @@ (t/is (= "32" (:font-size line))) (t/is (= "Hi" (:text line))))) -(t/deftest test-sync-updated-text-copy-when-changed-text +(t/deftest sync-updated-text-copy-when-changed-text (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -367,7 +367,7 @@ ;; The text doesn't change, because it was touched (t/is (= "Hi" (:text line))))) -(t/deftest test-sync-updated-text-copy-when-changed-both +(t/deftest sync-updated-text-copy-when-changed-both (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -417,7 +417,7 @@ ;; The text doesn't change, because it was touched (t/is (= "Hi" (:text line))))) -(t/deftest test-sync-updated-both-copy-when-changed-attribute +(t/deftest sync-updated-both-copy-when-changed-attribute (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -466,7 +466,7 @@ (t/is (= "14" (:font-size line))) (t/is (= "Hi" (:text line))))) -(t/deftest test-sync-updated-both-copy-when-changed-text +(t/deftest sync-updated-both-copy-when-changed-text (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -515,7 +515,7 @@ ;; The text doesn't change, because it was touched (t/is (= "Hi" (:text line))))) -(t/deftest test-sync-updated-both-copy-when-changed-both +(t/deftest sync-updated-both-copy-when-changed-both (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -567,7 +567,7 @@ ;; The text doesn't change, because it was touched (t/is (= "Hi" (:text line))))) -(t/deftest test-sync-updated-structure-same-attrs-copy-when-changed-attribute +(t/deftest sync-updated-structure-same-attrs-copy-when-changed-attribute (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -619,7 +619,7 @@ (t/is (= "32" (:font-size line))) (t/is (= "hello world" (:text line))))) -(t/deftest test-sync-updated-structure-same-attrs-copy-when-changed-text +(t/deftest sync-updated-structure-same-attrs-copy-when-changed-text (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -668,7 +668,7 @@ ;; The text doesn't change, because the structure was touched (t/is (= "hello world" (:text line))))) -(t/deftest test-sync-updated-structure-same-attrs-copy-when-changed-both +(t/deftest sync-updated-structure-same-attrs-copy-when-changed-both (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -722,7 +722,7 @@ ;; The text doesn't change, because the structure was touched (t/is (= "hello world" (:text line))))) -(t/deftest test-sync-updated-structure-diff-attrs-copy-when-changed-attribute +(t/deftest sync-updated-structure-diff-attrs-copy-when-changed-attribute (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -775,7 +775,7 @@ (t/is (= "14" (:font-size line))) (t/is (= "hello world" (:text line))))) -(t/deftest test-sync-updated-structure-diff-attrs-copy-when-changed-text +(t/deftest sync-updated-structure-diff-attrs-copy-when-changed-text (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -825,7 +825,7 @@ ;; The text doesn't change, because the structure was touched (t/is (= "hello world" (:text line))))) -(t/deftest test-sync-updated-structure-diff-attrs-copy-when-changed-both +(t/deftest sync-updated-structure-diff-attrs-copy-when-changed-both (let [;; ==== Setup file0 (-> (thf/sample-file :file1) (tho/add-frame-with-text :main-root :main-child "hello world") @@ -878,4 +878,4 @@ ;; The attr doesn't change, because not all the attrs on the structure are equal (t/is (= "14" (:font-size line))) ;; The text doesn't change, because the structure was touched - (t/is (= "hello world" (:text line))))) \ No newline at end of file + (t/is (= "hello world" (:text line))))) diff --git a/common/test/common_tests/types/fill_test.cljc b/common/test/common_tests/types/fill_test.cljc index de1514cccb..f299115b90 100644 --- a/common/test/common_tests/types/fill_test.cljc +++ b/common/test/common_tests/types/fill_test.cljc @@ -15,7 +15,7 @@ [app.common.schema.generators :as sg] [app.common.schema.test :as smt] [app.common.transit :as trans] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.uuid :as uuid] [clojure.test :as t])) @@ -85,8 +85,8 @@ :fill-opacity 0.7}) (t/deftest build-from-plain-1 - (let [fills (types.fill/from-plain [sample-fill-1])] - (t/is (types.fill/fills? fills)) + (let [fills (types.fills/from-plain [sample-fill-1])] + (t/is (types.fills/fills? fills)) (t/is (= 1 (count fills))) (t/is (equivalent-fill? (first fills) sample-fill-1)))) @@ -99,8 +99,8 @@ :keep-aspect-ratio false}}) (t/deftest build-from-plain-2 - (let [fills (types.fill/from-plain [sample-fill-2])] - (t/is (types.fill/fills? fills)) + (let [fills (types.fills/from-plain [sample-fill-2])] + (t/is (types.fills/fills? fills)) (t/is (= 1 (count fills))) (t/is (equivalent-fill? (first fills) sample-fill-2)))) @@ -117,8 +117,8 @@ :stops [{:color "#631aa8", :offset 0.5}]}}) (t/deftest build-from-plain-3 - (let [fills (types.fill/from-plain [sample-fill-3])] - (t/is (types.fill/fills? fills)) + (let [fills (types.fills/from-plain [sample-fill-3])] + (t/is (types.fills/fills? fills)) (t/is (= 1 (count fills))) (t/is (equivalent-fill? (first fills) sample-fill-3)))) @@ -136,8 +136,8 @@ :fill-color-ref-id #uuid "2eef07f1-e38a-8062-8006-3aa264d5b785"}) (t/deftest build-from-plain-4 - (let [fills (types.fill/from-plain [sample-fill-4])] - (t/is (types.fill/fills? fills)) + (let [fills (types.fills/from-plain [sample-fill-4])] + (t/is (types.fills/fills? fills)) (t/is (= 1 (count fills))) (t/is (equivalent-fill? (first fills) sample-fill-4)))) @@ -154,8 +154,8 @@ :stops [{:color "#bba1aa", :opacity 0.37, :offset 0.84}]}}) (t/deftest build-from-plain-5 - (let [fills (types.fill/from-plain [sample-fill-5])] - (t/is (types.fill/fills? fills)) + (let [fills (types.fills/from-plain [sample-fill-5])] + (t/is (types.fills/fills? fills)) (t/is (= 1 (count fills))) (t/is (equivalent-fill? (first fills) sample-fill-5)))) @@ -170,14 +170,14 @@ :stops [{:color "#e15610", :offset 0.4} {:color "#005a9e", :opacity 0.62, :offset 0.81}]}}) (t/deftest build-from-plain-6 - (let [fills (types.fill/from-plain [sample-fill-6])] - (t/is (types.fill/fills? fills)) + (let [fills (types.fills/from-plain [sample-fill-6])] + (t/is (types.fills/fills? fills)) (t/is (= 1 (count fills))) (t/is (equivalent-fill? (first fills) sample-fill-6)))) (t/deftest fills-datatype-roundtrip (smt/check! - (smt/for [fill (->> (sg/generator types.fill/schema:fill) + (smt/for [fill (->> (sg/generator types.fills/schema:fill) (sg/fmap d/without-nils) (sg/fmap (fn [fill] (cond-> fill @@ -187,27 +187,27 @@ (contains? fill :fill-color-ref-file))) (-> (assoc :fill-color-ref-file (uuid/next)) (assoc :fill-color-ref-id (uuid/next)))))))] - (let [bfills (types.fill/from-plain [fill])] + (let [bfills (types.fills/from-plain [fill])] (and (= (count bfills) 1) (equivalent-fill? (first bfills) fill)))) {:num 2000})) (t/deftest equality-operation - (let [fills1 (types.fill/from-plain [sample-fill-6]) - fills2 (types.fill/from-plain [sample-fill-6])] + (let [fills1 (types.fills/from-plain [sample-fill-6]) + fills2 (types.fills/from-plain [sample-fill-6])] (t/is (= fills1 fills2)))) (t/deftest reduce-impl - (let [fills1 (types.fill/from-plain [sample-fill-6]) + (let [fills1 (types.fills/from-plain [sample-fill-6]) fills2 (reduce (fn [result fill] (conj result fill)) [] fills1) - fills3 (types.fill/from-plain fills2)] + fills3 (types.fills/from-plain fills2)] (t/is (= fills1 fills3)))) (t/deftest indexed-access - (let [fills1 (types.fill/from-plain [sample-fill-6]) + (let [fills1 (types.fills/from-plain [sample-fill-6]) fill0 (nth fills1 0) fill1 (nth fills1 1)] (t/is (nil? fill1)) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 4b699a96bb..f8a927684d 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -20,7 +20,7 @@ [app.common.logic.shapes :as cls] [app.common.transit :as t] [app.common.types.component :as ctc] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.types.shape :as cts] [app.common.types.shape-tree :as ctst] [app.common.uuid :as uuid] @@ -144,7 +144,7 @@ (letfn [(process-map-form [form] (let [fills (get form :fills)] (if (vector? fills) - (assoc form :fills (types.fill/from-plain fills)) + (assoc form :fills (types.fills/from-plain fills)) form))) (process-form [form] diff --git a/frontend/src/app/main/data/workspace/colors.cljs b/frontend/src/app/main/data/workspace/colors.cljs index 0ed40e3e2e..80af0e32c6 100644 --- a/frontend/src/app/main/data/workspace/colors.cljs +++ b/frontend/src/app/main/data/workspace/colors.cljs @@ -13,7 +13,7 @@ [app.common.schema :as sm] [app.common.text :as txt] [app.common.types.color :as types.color] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.types.shape :as shp] [app.common.types.shape.shadow :refer [check-shadow]] [app.config :as cfg] @@ -153,7 +153,7 @@ (d/without-nils) :always - (types.fill/check-fill)) + (types.fills/check-fill)) transform-attrs #(transform % fill)] @@ -893,7 +893,7 @@ (update state :colorpicker (fn [{:keys [stops editing-stop] :as state}] (let [cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills)) - can-add-stop? (or (not cap-stops?) (< (count stops) types.fill/MAX-GRADIENT-STOPS))] + can-add-stop? (or (not cap-stops?) (< (count stops) types.fills/MAX-GRADIENT-STOPS))] (if can-add-stop? (if (cc/uniform-spread? stops) ;; Add to uniform @@ -939,7 +939,7 @@ (fn [state] (let [stops (:stops state) cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills)) - can-add-stop? (or (not cap-stops?) (< (count stops) types.fill/MAX-GRADIENT-STOPS))] + can-add-stop? (or (not cap-stops?) (< (count stops) types.fills/MAX-GRADIENT-STOPS))] (if can-add-stop? (let [new-stop (-> (cc/interpolate-gradient stops offset) (split-color-components)) stops (conj stops new-stop) @@ -963,7 +963,7 @@ (contains? cfg/flags :frontend-binary-fills)) stops (mapv split-color-components (if cap-stops? - (take types.fill/MAX-GRADIENT-STOPS stops) + (take types.fills/MAX-GRADIENT-STOPS stops) stops))] (-> state (assoc :current-color (get stops stop)) diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index 2e10a5318b..30be311268 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -16,7 +16,7 @@ [app.common.geom.shapes :as gsh] [app.common.math :as mth] [app.common.text :as txt] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.types.modifiers :as ctm] [app.common.uuid :as uuid] [app.main.data.event :as ev] @@ -237,7 +237,7 @@ (defn- to-new-fills [data] - [(d/without-nils (select-keys data types.fill/fill-attrs))]) + [(d/without-nils (select-keys data types.fills/fill-attrs))]) (defn- shape-current-values [shape pred attrs] @@ -247,7 +247,7 @@ (if (txt/is-text-node? node) (let [fills (cond - (types.fill/has-valid-fill-attrs? node) + (types.fills/has-valid-fill-attrs? node) (to-new-fills node) (some? (:fills node)) @@ -466,7 +466,7 @@ (defn migrate-node [node] - (let [color-attrs (not-empty (select-keys node types.fill/fill-attrs))] + (let [color-attrs (not-empty (select-keys node types.fills/fill-attrs))] (cond-> node (nil? (:fills node)) (assoc :fills []) diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index 147aa74991..18e06b8731 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -12,7 +12,7 @@ [app.common.data.macros :as dm] [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.config :as cfg] [app.main.data.event :as-alias ev] [app.main.data.modal :as modal] @@ -413,7 +413,7 @@ (when (= selected-mode :gradient) [:> gradients* {:type (:type state) - :stops (if cap-stops? (vec (take types.fill/MAX-GRADIENT-STOPS (:stops state))) (:stops state)) + :stops (if cap-stops? (vec (take types.fills/MAX-GRADIENT-STOPS (:stops state))) (:stops state)) :editing-stop (:editing-stop state) :on-stop-edit-start handle-stop-edit-start :on-stop-edit-finish handle-stop-edit-finish diff --git a/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs b/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs index 6ebfc2a1d1..203ff740b7 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker/gradients.cljs @@ -11,7 +11,7 @@ [app.common.data :as d] [app.common.data.macros :as dm] [app.common.math :as mth] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.config :as cfg] [app.main.features :as features] [app.main.ui.components.numeric-input :refer [numeric-input*]] @@ -288,7 +288,7 @@ (when on-reverse-stops (on-reverse-stops)))) cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills)) - add-stop-disabled? (when cap-stops? (>= (count stops) types.fill/MAX-GRADIENT-STOPS))] + add-stop-disabled? (when cap-stops? (>= (count stops) types.fills/MAX-GRADIENT-STOPS))] [:div {:class (stl/css :gradient-panel)} [:div {:class (stl/css :gradient-preview)} diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs index fd39a007ed..b3098d1f05 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/fill.cljs @@ -8,7 +8,7 @@ (:require-macros [app.main.style :as stl]) (:require [app.common.types.color :as ctc] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.types.shape.attrs :refer [default-color]] [app.config :as cfg] [app.main.data.workspace :as udw] @@ -28,7 +28,7 @@ (def ^:private xf:take-max-fills - (take types.fill/MAX-FILLS)) + (take types.fills/MAX-FILLS)) (def ^:private xf:enumerate @@ -101,7 +101,7 @@ can-add-fills? (if binary-fills-enabled? (and (not multiple?) - (< (count fills) types.fill/MAX-FILLS)) + (< (count fills) types.fills/MAX-FILLS)) (not ^boolean multiple?)) label diff --git a/frontend/src/app/main/ui/workspace/viewport/gradients.cljs b/frontend/src/app/main/ui/workspace/viewport/gradients.cljs index 2d75db9457..1f08b1103f 100644 --- a/frontend/src/app/main/ui/workspace/viewport/gradients.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/gradients.cljs @@ -15,7 +15,7 @@ [app.common.geom.shapes :as gsh] [app.common.geom.shapes.points :as gsp] [app.common.math :as mth] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.config :as cfg] [app.main.data.workspace.colors :as dc] [app.main.features :as features] @@ -135,7 +135,7 @@ handler-state (mf/use-state {:display? false :offset 0 :hover nil}) cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills)) - can-add-stop? (if cap-stops? (< (count stops) types.fill/MAX-GRADIENT-STOPS) true) + can-add-stop? (if cap-stops? (< (count stops) types.fills/MAX-GRADIENT-STOPS) true) endpoint-on-pointer-down (fn [position event] @@ -527,7 +527,7 @@ gradient (:gradient state) cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills)) stops (if cap-stops? - (vec (take types.fill/MAX-GRADIENT-STOPS (:stops state))) + (vec (take types.fills/MAX-GRADIENT-STOPS (:stops state))) (:stops state)) editing-stop (:editing-stop state)] diff --git a/frontend/src/app/plugins/shape.cljs b/frontend/src/app/plugins/shape.cljs index 2af5681994..031b8ea64a 100644 --- a/frontend/src/app/plugins/shape.cljs +++ b/frontend/src/app/plugins/shape.cljs @@ -20,7 +20,7 @@ [app.common.types.component :as ctk] [app.common.types.container :as ctn] [app.common.types.file :as ctf] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.types.grid :as ctg] [app.common.types.path :as path] [app.common.types.path.segment :as path.segm] @@ -709,7 +709,7 @@ id (:id shape) value (parser/parse-fills value)] (cond - (not (sm/validate [:vector types.fill/schema:fill] value)) + (not (sm/validate [:vector types.fills/schema:fill] value)) (u/display-not-valid :fills value) (cfh/text-shape? shape) diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index b598dd36f7..38f06a1a21 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -12,7 +12,7 @@ [app.common.data.macros :as dm] [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.types.path :as path] [app.common.types.shape.layout :as ctl] [app.common.uuid :as uuid] @@ -248,7 +248,7 @@ [shape-id fills] (if (empty? fills) (h/call wasm/internal-module "_clear_shape_fills") - (let [fills (take types.fill/MAX-FILLS fills) + (let [fills (take types.fills/MAX-FILLS fills) image-fills (filter :fill-image fills) offset (mem/alloc-bytes (* (count fills) sr-fills/FILL-BYTE-SIZE)) heap (mem/get-heap-u8) diff --git a/frontend/src/app/render_wasm/serializers/fills.cljs b/frontend/src/app/render_wasm/serializers/fills.cljs index b39e4a0dbd..8e8efee578 100644 --- a/frontend/src/app/render_wasm/serializers/fills.cljs +++ b/frontend/src/app/render_wasm/serializers/fills.cljs @@ -1,7 +1,7 @@ (ns app.render-wasm.serializers.fills (:require [app.common.data.macros :as dm] - [app.common.types.fill :as types.fill] + [app.common.types.fills :as types.fills] [app.common.uuid :as uuid] [app.render-wasm.serializers.color :as clr])) @@ -41,7 +41,7 @@ end-x (:end-x gradient) end-y (:end-y gradient) width (or (:width gradient) 0) - stops (take types.fill/MAX-GRADIENT-STOPS (:stops gradient)) + stops (take types.fills/MAX-GRADIENT-STOPS (:stops gradient)) type (if (= (:type gradient) :linear) 0x01 0x02)] (.setUint8 dview offset type true) (.setFloat32 dview (+ offset 4) start-x true)