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
Notes: sideshowbarker 2024-07-17 14:27:43 +09:00
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;