mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:08:13 +00:00
LibWeb: Position the ListItemMarkers according to their width
Previously they were positioned with a fixed offset. However this lead to wider markers with more than one character to collide with the element itself. Now the ListItemMarkerBox generates and stores the appropriate String in its constructor and sets its own width according to that. The ListItemBox then lays out the Marker taking this width into account. This also made the painting a lot easier since we don't generate the needed Strings every time we repaint, just once.
This commit is contained in:
parent
a51cee748f
commit
e7498bb918
3 changed files with 42 additions and 14 deletions
|
@ -37,8 +37,8 @@ void ListItemBox::layout_marker()
|
|||
append_child(*m_marker);
|
||||
}
|
||||
|
||||
m_marker->set_offset(-8, 0);
|
||||
m_marker->set_size(4, line_height());
|
||||
m_marker->set_offset(-(m_marker->width() + 4), 0);
|
||||
m_marker->set_height(line_height());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue