From 3ecb41b7d9a2e5361ee5e6421d44dd1cbe944580 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Tue, 29 Mar 2022 21:27:17 -0700 Subject: PDFViewer: Support a continuous page view mode --- Userland/Libraries/LibPDF/Document.h | 3 +++ Userland/Libraries/LibPDF/Renderer.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibPDF') diff --git a/Userland/Libraries/LibPDF/Document.h b/Userland/Libraries/LibPDF/Document.h index 127577de11..d7836bb237 100644 --- a/Userland/Libraries/LibPDF/Document.h +++ b/Userland/Libraries/LibPDF/Document.h @@ -23,6 +23,9 @@ struct Rectangle { float lower_left_y; float upper_right_x; float upper_right_y; + + float width() const { return upper_right_x - lower_left_x; } + float height() const { return upper_right_y - lower_left_y; } }; struct Page { diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp index 04f4fe5989..dbeff27279 100644 --- a/Userland/Libraries/LibPDF/Renderer.cpp +++ b/Userland/Libraries/LibPDF/Renderer.cpp @@ -38,8 +38,8 @@ Renderer::Renderer(RefPtr document, Page const& page, RefPtr(bitmap->width()) / width; float scale_y = static_cast(bitmap->height()) / height; userspace_matrix.scale(scale_x, scale_y); -- cgit v1.2.3