LayoutListItemMarker.cpp 604 B

12345678910111213141516171819
  1. #include <LibGUI/GPainter.h>
  2. #include <LibHTML/Layout/LayoutListItemMarker.h>
  3. LayoutListItemMarker::LayoutListItemMarker()
  4. : LayoutBox(nullptr, StyleProperties::create())
  5. {
  6. }
  7. LayoutListItemMarker::~LayoutListItemMarker()
  8. {
  9. }
  10. void LayoutListItemMarker::render(RenderingContext& context)
  11. {
  12. Rect bullet_rect { 0, 0, 4, 4 };
  13. bullet_rect.center_within(rect());
  14. // FIXME: It would be nicer to not have to go via the parent here to get our inherited style.
  15. context.painter().fill_rect(bullet_rect, parent()->style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black));
  16. }