pdf_view: tweaks for showing 16:10 slides

- Shave off two pixels on right, which are rendered white for no reason.
- Adjust resolution to make the slides fit vertically by default.
This commit is contained in:
Norman Feske 2021-01-12 14:15:16 +01:00
parent 5905e0a4a0
commit 0a478dac7f

View File

@ -136,7 +136,7 @@ class Pdf_view
* use case of showing slides.
*/
_pdfapp.resolution = Genode::min(_nit_mode.area.w()/5,
_nit_mode.area.h()/3.8);
_nit_mode.area.h()/4);
typedef Gui::Session::Command Command;
_gui.enqueue<Command::Geometry>(_view, Rect(Point(), _nit_mode.area));
@ -282,8 +282,11 @@ class Pdf_view
void Pdf_view::show()
{
auto reduce_by = [] (auto value, auto diff) {
return (value >= diff) ? value - diff : 0; };
Framebuffer::Area const fb_size = _fb_mode.area;
int const x_max = Genode::min((int)fb_size.w(), _pdfapp.image->w);
int const x_max = Genode::min((int)fb_size.w(), reduce_by(_pdfapp.image->w, 2));
int const y_max = Genode::min((int)fb_size.h(), _pdfapp.image->h);
/* clear framebuffer */