diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-03-09 17:07:52 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-03-09 17:07:52 +0100 |
commit | e522c4ea04e9d899907deb5d0304f7de0823e9da (patch) | |
tree | 8b93d0deff02a8bf2732b86cb074d64dae0abecc /src | |
parent | 81963c7b44194be63479299f217e97e2d0c48db5 (diff) |
rename --inner-geometry to --offset, discard width and height values
Diffstat (limited to 'src')
-rw-r--r-- | src/options.c | 6 | ||||
-rw-r--r-- | src/options.h | 8 | ||||
-rw-r--r-- | src/winwidget.c | 16 |
3 files changed, 14 insertions, 16 deletions
diff --git a/src/options.c b/src/options.c index 0db5aae..bc95604 100644 --- a/src/options.c +++ b/src/options.c @@ -416,7 +416,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"no-recursive" , 0, 0, 241}, {"cache-size" , 1, 0, 243}, {"version-sort" , 0, 0, 246}, - {"inner-geometry", 1, 0, 247}, + {"offset" , 1, 0, 247}, {0, 0, 0, 0} }; int optch = 0, cmdx = 0; @@ -786,8 +786,8 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) opt.version_sort = 1; break; case 247: - opt.inner_geom_flags = XParseGeometry(optarg, &opt.inner_geom_x, - &opt.inner_geom_y, &opt.inner_geom_w, &opt.inner_geom_h); + opt.offset_flags = XParseGeometry(optarg, &opt.offset_x, + &opt.offset_y, (unsigned int *)&discard, (unsigned int *)&discard); break; default: break; diff --git a/src/options.h b/src/options.h index d4ffbeb..ed8641a 100644 --- a/src/options.h +++ b/src/options.h @@ -111,11 +111,9 @@ struct __fehoptions { int geom_y; unsigned int geom_w; unsigned int geom_h; - int inner_geom_flags; - int inner_geom_x; - int inner_geom_y; - unsigned int inner_geom_w; - unsigned int inner_geom_h; + int offset_flags; + int offset_x; + int offset_y; int default_zoom; int zoom_mode; unsigned char adjust_reload; diff --git a/src/winwidget.c b/src/winwidget.c index 7b8a9dc..beae9fa 100644 --- a/src/winwidget.c +++ b/src/winwidget.c @@ -565,18 +565,18 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias) */ if (need_center || resize) { - if ((opt.inner_geom_flags & XValue) && (winwid->im_w * winwid->zoom) > winwid->w) { - if (opt.inner_geom_flags & XNegative) { - winwid->im_x = winwid->w - (winwid->im_w * winwid->zoom) - opt.inner_geom_x; + if ((opt.offset_flags & XValue) && (winwid->im_w * winwid->zoom) > winwid->w) { + if (opt.offset_flags & XNegative) { + winwid->im_x = winwid->w - (winwid->im_w * winwid->zoom) - opt.offset_x; } else { - winwid->im_x = - opt.inner_geom_x * winwid->zoom; + winwid->im_x = - opt.offset_x * winwid->zoom; } } - if ((opt.inner_geom_flags & YValue) && (winwid->im_h * winwid->zoom) > winwid->h) { - if (opt.inner_geom_flags & YNegative) { - winwid->im_y = winwid->h - (winwid->im_h * winwid->zoom) - opt.inner_geom_y; + if ((opt.offset_flags & YValue) && (winwid->im_h * winwid->zoom) > winwid->h) { + if (opt.offset_flags & YNegative) { + winwid->im_y = winwid->h - (winwid->im_h * winwid->zoom) - opt.offset_y; } else { - winwid->im_y = - opt.inner_geom_y * winwid->zoom; + winwid->im_y = - opt.offset_y * winwid->zoom; } } } |