mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibGfx: Add missing TextAlignment::BottomLeft
This commit is contained in:
parent
8cbdcffd05
commit
9dd3203cc6
Notes:
sideshowbarker
2024-07-18 17:39:20 +09:00
Author: https://github.com/linusg
Commit: 9dd3203cc6
Pull-request: https://github.com/SerenityOS/serenity/pull/7329
6 changed files with 19 additions and 5 deletions
|
@ -1229,6 +1229,7 @@ void draw_text_line(const IntRect& a_rect, const TextType& text, const Font& fon
|
|||
switch (alignment) {
|
||||
case TextAlignment::TopLeft:
|
||||
case TextAlignment::CenterLeft:
|
||||
case TextAlignment::BottomLeft:
|
||||
break;
|
||||
case TextAlignment::TopRight:
|
||||
case TextAlignment::CenterRight:
|
||||
|
@ -1501,6 +1502,9 @@ void do_draw_text(const IntRect& rect, const TextType& text, const Font& font, T
|
|||
case TextAlignment::Center:
|
||||
bounding_rect.center_within(rect);
|
||||
break;
|
||||
case TextAlignment::BottomLeft:
|
||||
bounding_rect.set_location({ rect.x(), (rect.bottom() + 1) - bounding_rect.height() });
|
||||
break;
|
||||
case TextAlignment::BottomRight:
|
||||
bounding_rect.set_location({ (rect.right() + 1) - bounding_rect.width(), (rect.bottom() + 1) - bounding_rect.height() });
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue