From d8065cc16cda34a8e4fdcbca208a8caaf05a67be Mon Sep 17 00:00:00 2001 From: Henry Wong Date: Sun, 21 Sep 2025 19:02:00 -0700 Subject: [PATCH 1/3] Fix ctrl dot color: Use stroke color for fill. --- src/ui/tools/freehand-base.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 4c70f2cd4b..37f0d32479 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -879,14 +879,19 @@ void spdc_create_single_dot(ToolBase *tool, Geom::Point const &pt, char const *p stroke_width = style.stroke_width.computed; } - // unset stroke and set fill color to former stroke color - bool cali = strcmp(path, "/tools/calligraphic"); - auto fill = sp_desktop_get_color_tool(desktop, path, cali); - auto stroke = sp_desktop_get_color_tool(desktop, path, false); SPCSSAttr *css = sp_repr_css_attr_new(); - sp_repr_css_set_property_string(css, "fill", fill ? fill->toString() : "none"); - sp_repr_css_set_property_string(css, "stroke", !cali && stroke ? stroke->toString() : "none"); + auto stroke = sp_desktop_get_color_tool(desktop, path, false); + if (!strcmp(path, "/tools/calligraphic")) { + // Calligraphic: Preserve fill and stroke + auto fill = sp_desktop_get_color_tool(desktop, path, true); + sp_repr_css_set_property_string(css, "fill", fill ? fill->toString() : "none"); + sp_repr_css_set_property_string(css, "stroke", stroke ? stroke->toString() : "none"); + } else { + // Not calligraphic: unset stroke and set fill color to former stroke color + sp_repr_css_set_property_string(css, "fill", stroke ? stroke->toString() : "none"); + sp_repr_css_set_property_string(css, "stroke", "none"); + } sp_repr_css_set(repr, css, "style"); sp_repr_css_attr_unref(css); -- GitLab From 76cfb2d1feee7117bcceccdc98d16eb1dfcb51a5 Mon Sep 17 00:00:00 2001 From: Henry Wong Date: Mon, 22 Sep 2025 10:42:20 -0700 Subject: [PATCH 2/3] Improve comment --- src/ui/tools/freehand-base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 37f0d32479..afdd77c216 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -888,7 +888,7 @@ void spdc_create_single_dot(ToolBase *tool, Geom::Point const &pt, char const *p sp_repr_css_set_property_string(css, "fill", fill ? fill->toString() : "none"); sp_repr_css_set_property_string(css, "stroke", stroke ? stroke->toString() : "none"); } else { - // Not calligraphic: unset stroke and set fill color to former stroke color + // Not calligraphic: Make a dot with no stroke and filled with current stroke color sp_repr_css_set_property_string(css, "fill", stroke ? stroke->toString() : "none"); sp_repr_css_set_property_string(css, "stroke", "none"); } -- GitLab From 513e13db775d90cdaaeb2d184fb15f09820f577a Mon Sep 17 00:00:00 2001 From: Henry Wong Date: Mon, 22 Sep 2025 11:52:55 -0700 Subject: [PATCH 3/3] clang-format complained about extra spaces --- src/ui/tools/freehand-base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index afdd77c216..1eb4cefcd1 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -885,11 +885,11 @@ void spdc_create_single_dot(ToolBase *tool, Geom::Point const &pt, char const *p if (!strcmp(path, "/tools/calligraphic")) { // Calligraphic: Preserve fill and stroke auto fill = sp_desktop_get_color_tool(desktop, path, true); - sp_repr_css_set_property_string(css, "fill", fill ? fill->toString() : "none"); + sp_repr_css_set_property_string(css, "fill", fill ? fill->toString() : "none"); sp_repr_css_set_property_string(css, "stroke", stroke ? stroke->toString() : "none"); } else { // Not calligraphic: Make a dot with no stroke and filled with current stroke color - sp_repr_css_set_property_string(css, "fill", stroke ? stroke->toString() : "none"); + sp_repr_css_set_property_string(css, "fill", stroke ? stroke->toString() : "none"); sp_repr_css_set_property_string(css, "stroke", "none"); } sp_repr_css_set(repr, css, "style"); -- GitLab