1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:37:35 +00:00

LibGfx: Add support for TextAlignment::TopCenter / BottomCenter

Now supports TextAlignment::TopCenter and TextAlignment::BottomCenter
for the Painter::draw_text.

Also patched this in Spreadsheet/CellTypeDialog.cpp
This commit is contained in:
Vrins 2022-02-27 01:33:48 +01:00 committed by Andreas Kling
parent 73ade62d4f
commit 3b22fd9a9f
5 changed files with 33 additions and 2 deletions

View file

@ -74,10 +74,12 @@ constexpr static CellTypeDialog::VerticalAlignment vertical_alignment_from(Gfx::
case Gfx::TextAlignment::Center:
return CellTypeDialog::VerticalAlignment::Center;
case Gfx::TextAlignment::TopCenter:
case Gfx::TextAlignment::TopRight:
case Gfx::TextAlignment::TopLeft:
return CellTypeDialog::VerticalAlignment::Top;
case Gfx::TextAlignment::BottomCenter:
case Gfx::TextAlignment::BottomLeft:
case Gfx::TextAlignment::BottomRight:
return CellTypeDialog::VerticalAlignment::Bottom;
@ -89,7 +91,9 @@ constexpr static CellTypeDialog::VerticalAlignment vertical_alignment_from(Gfx::
constexpr static CellTypeDialog::HorizontalAlignment horizontal_alignment_from(Gfx::TextAlignment alignment)
{
switch (alignment) {
case Gfx::TextAlignment::BottomCenter:
case Gfx::TextAlignment::Center:
case Gfx::TextAlignment::TopCenter:
return CellTypeDialog::HorizontalAlignment::Center;
case Gfx::TextAlignment::TopRight: