mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibPDF+PDFViewer: Extract Renderer::apply_page_rotation()
No behavior change.
This commit is contained in:
parent
5e9395b808
commit
03fab7089a
3 changed files with 15 additions and 9 deletions
|
@ -350,15 +350,7 @@ PDF::PDFErrorOr<NonnullRefPtr<Gfx::Bitmap>> PDFViewer::render_page(u32 page_inde
|
|||
return bitmap;
|
||||
}
|
||||
|
||||
int rotation_count = ((page.rotate + m_rotations) / 90) % 4;
|
||||
if (rotation_count == 1)
|
||||
bitmap = TRY(bitmap->rotated(Gfx::RotationDirection::Clockwise));
|
||||
else if (rotation_count == 2)
|
||||
bitmap = TRY(bitmap->rotated(Gfx::RotationDirection::Flip));
|
||||
else if (rotation_count == 3)
|
||||
bitmap = TRY(bitmap->rotated(Gfx::RotationDirection::CounterClockwise));
|
||||
|
||||
return bitmap;
|
||||
return TRY(PDF::Renderer::apply_page_rotation(bitmap, page, m_rotations));
|
||||
}
|
||||
|
||||
PDF::PDFErrorOr<void> PDFViewer::cache_page_dimensions(bool recalculate_fixed_info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue