Command.cpp 855 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Painting/Command.h>
  7. #include <LibWeb/Painting/ShadowPainting.h>
  8. namespace Web::Painting {
  9. void DrawGlyphRun::translate_by(Gfx::IntPoint const& offset)
  10. {
  11. rect.translate_by(offset);
  12. translation.translate_by(offset.to_type<float>());
  13. }
  14. Gfx::IntRect PaintOuterBoxShadow::bounding_rect() const
  15. {
  16. return get_outer_box_shadow_bounding_rect(outer_box_shadow_params);
  17. }
  18. void PaintOuterBoxShadow::translate_by(Gfx::IntPoint const& offset)
  19. {
  20. outer_box_shadow_params.device_content_rect.translate_by(offset.to_type<DevicePixels>());
  21. }
  22. void PaintInnerBoxShadow::translate_by(Gfx::IntPoint const& offset)
  23. {
  24. outer_box_shadow_params.device_content_rect.translate_by(offset.to_type<DevicePixels>());
  25. }
  26. }