diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-17 13:41:03 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-17 13:41:03 +0200 |
commit | 32b9d80ee598e0a40ca700acb49bbe442d82e379 (patch) | |
tree | 814c66c3d291ba040fab873838a634b00ba0ab7e | |
parent | 8c863ad9590da806b5367a27a346182a072d10da (diff) | |
download | serenity-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.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGfx/Painter.h | 2 |
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; } |