mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:17:45 +00:00
LibGfx: Make Rect::align_within() correct for TopCenter and BottomCenter
Also update the LibGfxDemo to actually show off these alignments.
This commit is contained in:
parent
f63ecc2763
commit
c55739bbc0
2 changed files with 5 additions and 2 deletions
|
@ -898,7 +898,8 @@ public:
|
|||
center_within(other);
|
||||
return;
|
||||
case TextAlignment::TopCenter:
|
||||
set_x(other.x() + other.width() / 2);
|
||||
center_horizontally_within(other);
|
||||
set_y(other.y());
|
||||
return;
|
||||
case TextAlignment::TopLeft:
|
||||
set_location(other.location());
|
||||
|
@ -916,7 +917,7 @@ public:
|
|||
center_vertically_within(other);
|
||||
return;
|
||||
case TextAlignment::BottomCenter:
|
||||
set_x(other.x() + other.width() / 2);
|
||||
center_horizontally_within(other);
|
||||
set_y(other.y() + other.height() - height());
|
||||
return;
|
||||
case TextAlignment::BottomLeft:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue