summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-17 13:41:03 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-17 13:41:03 +0200
commit32b9d80ee598e0a40ca700acb49bbe442d82e379 (patch)
tree814c66c3d291ba040fab873838a634b00ba0ab7e
parent8c863ad9590da806b5367a27a346182a072d10da (diff)
downloadserenity-32b9d80ee598e0a40ca700acb49bbe442d82e379.zip
LibGfx: Make Painter::fill_path() take Path by const reference
Taking a mutable reference here made the API look very strange.
-rw-r--r--Userland/Libraries/LibGfx/Painter.cpp4
-rw-r--r--Userland/Libraries/LibGfx/Painter.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp
index 719b52277b..da50c27bb9 100644
--- a/Userland/Libraries/LibGfx/Painter.cpp
+++ b/Userland/Libraries/LibGfx/Painter.cpp
@@ -2005,11 +2005,11 @@ void Painter::stroke_path(const Path& path, Color color, int thickness)
from.set_x(previous_to.value().x());
}
-void Painter::fill_path(Path& path, Color color, WindingRule winding_rule)
+void Painter::fill_path(Path const& path, Color color, WindingRule winding_rule)
{
VERIFY(scale() == 1); // FIXME: Add scaling support.
- const auto& segments = path.split_lines();
+ auto const& segments = path.split_lines();
if (segments.size() == 0)
return;
diff --git a/Userland/Libraries/LibGfx/Painter.h b/Userland/Libraries/LibGfx/Painter.h
index 96b9c2be6a..f125d97700 100644
--- a/Userland/Libraries/LibGfx/Painter.h
+++ b/Userland/Libraries/LibGfx/Painter.h
@@ -97,7 +97,7 @@ public:
Nonzero,
EvenOdd,
};
- void fill_path(Path&, Color, WindingRule rule = WindingRule::Nonzero);
+ void fill_path(Path const&, Color, WindingRule rule = WindingRule::Nonzero);
const Font& font() const { return *state().font; }
void set_font(const Font& font) { state().font = &font; }