mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
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:
parent
5905e0a4a0
commit
0a478dac7f
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user