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

PDFViewer: Add actions to rotate the displayed PDF

This implements the rotate cw/ccw actions in PDFViewer.
Since the rendered pages are stored in a HashMap for caching,
the bitmap is wrapped in a struct with the current rotation.
This way the caching works as expected while zooming, and a new bitmap
is rendered when the page is rotated.
This commit is contained in:
Marcus Nilsson 2022-01-03 00:24:11 +01:00 committed by Andreas Kling
parent cecbed467b
commit eb97617ff0
4 changed files with 36 additions and 7 deletions

View file

@ -38,6 +38,8 @@ private:
RefPtr<GUI::Action> m_zoom_in_action;
RefPtr<GUI::Action> m_zoom_out_action;
RefPtr<GUI::Action> m_reset_zoom_action;
RefPtr<GUI::Action> m_rotate_counterclockwise_action;
RefPtr<GUI::Action> m_rotate_clockwise_action;
bool m_sidebar_open { false };
ByteBuffer m_buffer;