ladybird/Userland/Libraries/LibPDF
Rodrigo Tobar 82bac7e665 LibPDF: Fix clipping of painting operations
While the clipping logic was correct (current v/s new clipping path),
the clipping path contents weren't. This commit fixed that.

We calculate the clipping path in two places: when we set it to be the
whole page at graphics state creation time, and when we perform clipping
path intersection to calculate a new clipping path. The clipping path is
then used to limit painting by passing it to the painter (more
precisely, but passing its bounding box to the painter, as the latter
doesn't support arbitrary path clipping). For this last point the
clipping path must be in device coordinates.

There was however a mix of coordinate systems involved in the creation,
update and usage of the clipping path:

 * The initial values of the path (i.e., the whole page) were in user
   coordinates.
 * Clipping path intersection was performed against m_current_path,
   which is in device coordinates.
 * To perform the clipping operation, the current clipping path was
   assumed to be in user coordinates.

This mix resulted in the clipping not working correctly depending on the
zoom level at which one visualised a page.

This commit fixes the issue by always keeping track of the clipping path
in device coordinates. This means that the initial full-page contents
are now converted to device coordinates before putting them in the
graphics state, and that no mapping is performed when applied the
clipping to the painter.
2023-02-04 12:29:57 +01:00
..
Fonts LibPDF: Simplify Encoding to align with simple font requirements 2023-02-02 14:50:38 +01:00
CMakeLists.txt LibPDF: Add initial CFF parsing 2023-01-25 15:40:11 +01:00
ColorSpace.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
ColorSpace.h AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
CommonNames.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
CommonNames.h LibPDF: Load Type1C fonts when found 2023-01-25 15:40:11 +01:00
Document.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
Document.h AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
DocumentParser.cpp AK: Move memory streams from LibCore 2023-01-29 19:16:44 -07:00
DocumentParser.h LibPDF: Use Core::Stream to parse the page offset hint table 2023-01-21 00:45:33 +00:00
Encoding.cpp LibPDF: Simplify Encoding to align with simple font requirements 2023-02-02 14:50:38 +01:00
Encoding.h LibPDF: Simplify Encoding to align with simple font requirements 2023-02-02 14:50:38 +01:00
Encryption.cpp LibPDF: Fix calculation of encryption key 2023-01-04 11:10:37 -05:00
Encryption.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
Error.h LibPDF: Add Errors class that accumulate multiple errors 2022-12-16 10:04:23 +01:00
Filter.cpp LibGfx: Re-structure the whole initialization pattern for image decoders 2023-01-20 15:13:31 +00:00
Filter.h AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
Forward.h Everywhere: Remove unused includes of AK/StdLibExtras.h 2023-01-02 20:27:20 -05:00
Interpolation.cpp LibPDF: Add first interpolation methods 2022-12-10 10:49:03 +01:00
Interpolation.h LibPDF: Add first interpolation methods 2022-12-10 10:49:03 +01:00
Object.h AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
ObjectDerivatives.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
ObjectDerivatives.h AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
Operator.h Everywhere: Rename to_{string => deprecated_string}() where applicable 2022-12-06 08:54:33 +01:00
Parser.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
Parser.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
Reader.cpp LibPDF: Parse floating point numbers that omit a leading zero correctly 2022-10-16 17:44:54 +02:00
Reader.h LibPDF: Add Reader::try_read for easier error propagation 2023-01-25 15:40:11 +01:00
Reference.h LibPDF: Extract reference bitpacking into dedicated class 2021-09-20 17:39:36 +04:30
Renderer.cpp LibPDF: Fix clipping of painting operations 2023-02-04 12:29:57 +01:00
Renderer.h LibPDF: Switch to best-effort PDF rendering 2022-12-16 10:04:23 +01:00
Value.cpp Everywhere: Stop shoving things into ::std and mentioning them as such 2022-12-14 11:44:32 +01:00
Value.h Everywhere: Stop shoving things into ::std and mentioning them as such 2022-12-14 11:44:32 +01:00
XRefTable.h Everywhere: Rename to_{string => deprecated_string}() where applicable 2022-12-06 08:54:33 +01:00