BordersData.cpp 993 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Painting/BordersData.h>
  7. #include <LibWeb/Painting/PaintContext.h>
  8. namespace Web::Painting {
  9. BordersDataDevicePixels BordersData::to_device_pixels(PaintContext const& context) const
  10. {
  11. return BordersDataDevicePixels {
  12. BorderDataDevicePixels {
  13. top.color,
  14. top.line_style,
  15. context.enclosing_device_pixels(top.width).value() },
  16. BorderDataDevicePixels {
  17. right.color,
  18. right.line_style,
  19. context.enclosing_device_pixels(right.width).value() },
  20. BorderDataDevicePixels {
  21. bottom.color,
  22. bottom.line_style,
  23. context.enclosing_device_pixels(bottom.width).value() },
  24. BorderDataDevicePixels {
  25. left.color,
  26. left.line_style,
  27. context.enclosing_device_pixels(left.width).value() }
  28. };
  29. }
  30. }