Compare commits

..

1 Commits

Author SHA1 Message Date
Alejandro Alonso
d614b4902f 🐛 Fix blur 0 artifacts 2026-02-18 07:57:13 +01:00
5 changed files with 17 additions and 36 deletions

View File

@@ -1150,24 +1150,3 @@
[changes]
(::page-id (meta changes)))
(defn set-text-content
[changes id content prev-content]
(assert-page-id! changes)
(let [page-id (::page-id (meta changes))
redo-change
{:type :mod-obj
:page-id page-id
:id id
:operations [{:type :set :attr :content :val content}]}
undo-change
{:type :mod-obj
:page-id page-id
:id id
:operations [{:type :set :attr :content :val prev-content}]}]
(-> changes
(update :redo-changes conj redo-change)
(update :undo-changes conj undo-change))))

View File

@@ -10,7 +10,6 @@
[app.common.attrs :as attrs]
[app.common.data :as d]
[app.common.data.macros :as dm]
[app.common.files.changes-builder :as pcb]
[app.common.files.helpers :as cfh]
[app.common.geom.point :as gpt]
[app.common.geom.shapes :as gsh]
@@ -20,7 +19,6 @@
[app.common.types.shape.layout :as ctl]
[app.common.types.text :as txt]
[app.common.uuid :as uuid]
[app.main.data.changes :as dch]
[app.main.data.event :as ev]
[app.main.data.helpers :as dsh]
[app.main.data.workspace.common :as dwc]
@@ -918,11 +916,11 @@
(update-in state [:workspace-text-modifier shape-id] {:position-data position-data}))))
(defn v2-update-text-shape-content
[id content & {:keys [update-name? name finalize? save-undo? original-content]
:or {update-name? false name nil finalize? false save-undo? true original-content nil}}]
[id content & {:keys [update-name? name finalize? save-undo?]
:or {update-name? false name nil finalize? false save-undo? true}}]
(ptk/reify ::v2-update-text-shape-content
ptk/WatchEvent
(watch [it state _]
(watch [_ state _]
(if (features/active-feature? state "render-wasm/v1")
(let [objects (dsh/lookup-page-objects state)
shape (get objects id)
@@ -972,13 +970,7 @@
{:save-undo? false}))
(dws/deselect-shape id)
(dwsh/delete-shapes #{id})))
(rx/of
;; This commit is necesary for undo and component propagation
;; on finalization
(dch/commit-changes
(-> (pcb/empty-changes it (:current-page-id state))
(pcb/set-text-content id content original-content)))
(dwt/finish-transform))))))
(rx/of (dwt/finish-transform))))))
(let [objects (dsh/lookup-page-objects state)
shape (get objects id)

View File

@@ -118,8 +118,7 @@
:update-name? update-name?
:name generated-name
:finalize? true
:save-undo? false
:original-content original-content))))
:save-undo? false))))
(let [container-node (mf/ref-val container-ref)]
(dom/set-style! container-node "opacity" 0)))

View File

@@ -48,6 +48,17 @@ impl Shadow {
}
pub fn get_drop_shadow_filter(&self) -> Option<ImageFilter> {
if self.blur <= 0.0 && self.spread <= 0.0 {
// Avoid Skia's DropShadowOnly path for hard shadows because it can
// introduce soft alpha on the contour even with zero blur.
let filter = image_filters::offset((self.offset.0, self.offset.1), None, None);
return image_filters::color_filter(
skia::color_filters::blend(self.color, skia::BlendMode::SrcIn).unwrap(),
filter,
None,
);
}
let mut filter = image_filters::drop_shadow_only(
(self.offset.0, self.offset.1),
(self.blur, self.blur),

View File

@@ -14,7 +14,7 @@ pushd $_SCRIPT_DIR;
cargo watch \
--why \
-i "_tmp*" \
-i "_tmp*"
-x "build $CARGO_PARAMS" \
-s "./build" \
-s "echo 'DONE\n'";