diff options
author | Andreas Kling <kling@serenityos.org> | 2023-01-09 18:51:22 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-09 19:54:26 +0100 |
commit | c55739bbc02f01bef58849c844eb8d3c3ce74fcf (patch) | |
tree | 8e7940902d4de4973b48252ba00fbe7774b17ded /Userland/Demos | |
parent | f63ecc2763c988c4697a47b4d3e17d745bb0181e (diff) | |
download | serenity-c55739bbc02f01bef58849c844eb8d3c3ce74fcf.zip |
LibGfx: Make Rect::align_within() correct for TopCenter and BottomCenter
Also update the LibGfxDemo to actually show off these alignments.
Diffstat (limited to 'Userland/Demos')
-rw-r--r-- | Userland/Demos/LibGfxDemo/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp index 36150d8af2..a846aad1e9 100644 --- a/Userland/Demos/LibGfxDemo/main.cpp +++ b/Userland/Demos/LibGfxDemo/main.cpp @@ -139,9 +139,11 @@ void Canvas::draw() painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "Center"sv, Gfx::TextAlignment::Center, Color::White); painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "CenterRight"sv, Gfx::TextAlignment::CenterRight, Color::White); painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "TopLeft"sv, Gfx::TextAlignment::TopLeft, Color::White); + painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "TopCenter"sv, Gfx::TextAlignment::TopCenter, Color::White); painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "TopRight"sv, Gfx::TextAlignment::TopRight, Color::White); painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "BottomLeft"sv, Gfx::TextAlignment::BottomLeft, Color::White); painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "BottomRight"sv, Gfx::TextAlignment::BottomRight, Color::White); + painter.draw_text(Gfx::IntRect { 520, 260, 240, 80 }, "BottomCenter"sv, Gfx::TextAlignment::BottomCenter, Color::White); painter.draw_rect({ 520, 360, 240, 30 }, Color::DarkGray); painter.draw_text(Gfx::IntRect { 520, 360, 240, 30 }, "Emojis! 🙂😂🐞🦄"sv, Gfx::TextAlignment::Center, Color::White); |