From: Ali Gholami Rudi Date: Tue, 14 Feb 2012 18:53:50 +0000 (+0330) Subject: fbff: fit the screen vertically if needed X-Git-Url: https://repo.or.cz/w/fbff.git/commitdiff_plain/f1356b840e4999245b69ad57db5ca28c5317c045 fbff: fit the screen vertically if needed Fitting the screen horizontally used to cut the lower parts of the video. This patch fits the screen vertically if this happens. Suggested by Sara Fauzia --- diff --git a/fbff.c b/fbff.c index 1c32b36..52e6252 100644 --- a/fbff.c +++ b/fbff.c @@ -391,8 +391,11 @@ int main(int argc, char *argv[]) ffs_vinfo(vffs, &w, &h); if (magnify != 1 && sizeof(fbval_t) != FBM_BPP(fb_mode())) fprintf(stderr, "fbff: magnify != 1 and fbval_t doesn't match\n"); - if (fullscreen) - zoom = (float) fb_cols() / w / magnify; + if (fullscreen) { + float hz = (float) fb_rows() / h / magnify; + float wz = (float) fb_cols() / w / magnify; + zoom = hz < wz ? hz : wz; + } ffs_vsetup(vffs, zoom, fb_mode()); } term_setup();