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

PDFViewer: Clear rendered page cache on application resize

When resizing the application, the pages are expected to grow or shrink
proportionally. This means that after a resize, we need to rerender
every page.
This commit is contained in:
Matthew Olsson 2022-03-27 09:11:02 -07:00 committed by Andreas Kling
parent 8da99c3014
commit b2f79a74d4
2 changed files with 13 additions and 0 deletions

View file

@ -18,6 +18,11 @@ class PDFViewer : public GUI::AbstractScrollableWidget {
C_OBJECT(PDFViewer)
public:
enum class PageViewMode {
Single,
Multiple,
};
virtual ~PDFViewer() override = default;
ALWAYS_INLINE u32 current_page() const { return m_current_page_index; }
@ -37,6 +42,7 @@ protected:
PDFViewer();
virtual void paint_event(GUI::PaintEvent&) override;
virtual void resize_event(GUI::ResizeEvent&) override;
virtual void mousewheel_event(GUI::MouseEvent&) override;
virtual void mousedown_event(GUI::MouseEvent&) override;
virtual void mouseup_event(GUI::MouseEvent&) override;