serenity/Userland
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
..
Applets AK: Move Stream and SeekableStream from LibCore 2023-01-29 19:16:44 -07:00
Applications Chess+GamesSettings: Give chess pieces some breathing room 2023-02-04 12:29:03 +01:00
BuggieBox
Demos AK: Remove try_ prefix from FixedArray creation functions 2023-01-28 22:41:36 +01:00
DevTools SQLStudio: Display real column names in the results tab 2023-02-03 20:34:45 +01:00
DynamicLoader
Games Chess+GamesSettings: Give chess pieces some breathing room 2023-02-04 12:29:03 +01:00
Libraries LibPDF: Fix clipping of painting operations 2023-02-04 12:29:57 +01:00
Services LibSQL+SQLServer: Send result column names over IPC to SQL clients 2023-02-03 20:34:45 +01:00
Shell AK: Move memory streams from LibCore 2023-01-29 19:16:44 -07:00
Utilities LibSQL+Userland: Pass SQL IPC results to clients in a structure 2023-02-03 20:34:45 +01:00
CMakeLists.txt