1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 17:27:34 +00:00

LibPDF: Fix paths with negatively sized re (rect) commands

Turns out the width/height in a `re` command can be negative. This
results in rectangles with different winding orders. For example, a
negative width results in a reversed winding order.

Previously, this was lost by passing the rect through an
`AffineTransform` before constructing the path. So instead, this
constructs the rect path, and then transforms the resulting path.
This commit is contained in:
MacDue 2024-01-16 20:32:26 +00:00 committed by Sam Atkins
parent 6a4dd8fa47
commit d55867e563
2 changed files with 11 additions and 1 deletions

View file

@ -155,6 +155,8 @@ private:
template<typename T>
ALWAYS_INLINE Gfx::Rect<T> map(Gfx::Rect<T>) const;
Gfx::Path map(Gfx::Path const&) const;
Gfx::AffineTransform calculate_image_space_transformation(int width, int height);
PDFErrorOr<NonnullRefPtr<PDFFont>> get_font(FontCacheKey const&);