mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 20:32:56 +03:00
LibWeb: Convert text_indent css pixels to device pixels
This commit is contained in:
parent
148d74b103
commit
9469531100
Notes:
sideshowbarker
2024-07-17 02:39:10 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/9469531100 Pull-request: https://github.com/SerenityOS/serenity/pull/20277 Reviewed-by: https://github.com/AtkinsSJ ✅
@ -47,8 +47,10 @@ void ButtonPaintable::paint(PaintContext& context, PaintPhase phase) const
|
||||
auto text_rect = button_rect;
|
||||
|
||||
// Apply CSS text-indent property to text rect
|
||||
// FIXME: The second parameter to to_px() needs to be the block container’s own inline-axis inner size:
|
||||
// https://drafts.csswg.org/css-text-3/#propdef-text-indent
|
||||
auto text_indent = computed_values().text_indent().to_px(layout_box(), CSSPixels());
|
||||
text_rect.translate_by(text_indent.to_int(), 0);
|
||||
text_rect.translate_by(context.rounded_device_pixels(text_indent), 0);
|
||||
|
||||
// Apply button pressed state offset
|
||||
if (being_pressed()) {
|
||||
|
Loading…
Reference in New Issue
Block a user