Commit 03eb45b2 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Accept offset-only arguments for --geometry (closes #73)

parent 2c773b0a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ git HEAD
      (-f and -F may get mixed up)
      <https://github.com/derf/feh/issues/79>
    * Patch by Dennis Real: Add optional EXIF tag view support (make exif=1)
    * Accept offset-only arguments for --geometry
      <https://github.com/derf/feh/issues/73>

Mon, 02 Jan 2012 11:54:01 +0100  Daniel Friesel <derf@finalrewind.org>

+1 −1
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ screen size. The only exception is a
of 100, in which case images will always be shown at 100% zoom, no matter
their dimensions.
.
.It Cm -g , --geometry Ar width No x Ar height Op + Ar x No + Ar y
.It Cm -g , --geometry Oo Ar width No x Ar height Oc Op + Ar x No + Ar y
.
Limit (and don't change) the window size.  Takes an X-style geometry
.Ar string
+5 −4
Original line number Diff line number Diff line
@@ -410,19 +410,20 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
		D(("after scaling down image %dx%d\n", winwid->w, winwid->h));
	}

	if (!winwid->full_screen && ((gib_imlib_image_has_alpha(winwid->im)) || (opt.geom_flags)
	if (!winwid->full_screen && ((gib_imlib_image_has_alpha(winwid->im))
				     || (opt.geom_flags & (WidthValue | HeightValue))
				     || (winwid->im_x || winwid->im_y) || (winwid->zoom != 1.0)
				     || (winwid->w > winwid->im_w || winwid->h > winwid->im_h)
				     || (winwid->has_rotated)))
		feh_draw_checks(winwid);

	if (!winwid->full_screen && opt.zoom_mode
				     && (winwid->zoom == 1.0) && !opt.geom_flags
				     && (winwid->zoom == 1.0) && ! (opt.geom_flags & (WidthValue | HeightValue))
				     && (winwid->w > winwid->im_w) && (winwid->h > winwid->im_h))
		feh_calc_needed_zoom(&(winwid->zoom), winwid->im_w, winwid->im_h, winwid->w, winwid->h);


	if (resize && (winwid->full_screen || opt.geom_flags)) {
	if (resize && (winwid->full_screen || (opt.geom_flags & (WidthValue | HeightValue)))) {
		int smaller;	/* Is the image smaller than screen? */
		int max_w = 0, max_h = 0;

@@ -810,7 +811,7 @@ void winwidget_resize(winwidget winwid, int w, int h)
	D(("   x %d y %d w %d h %d\n", attributes.x, attributes.y, winwid->w,
		winwid->h));

	if (opt.geom_flags) {
	if (opt.geom_flags & (WidthValue | HeightValue)) {
		winwid->had_resize = 1;
		return;
	}
+8 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ use autodie qw/:all/;

use Cwd;
use GD qw/:DEFAULT :cmp/;
use Test::More tests => 53;
use Test::More tests => 54;
use Time::HiRes qw/sleep/;
use X11::GUITest qw/:ALL/;

@@ -194,6 +194,13 @@ feh_start(
test_scr('index_full_h400');
feh_stop();

feh_start(
	'--geometry +10+20',
	'test/ok/png'
);
test_scr('geometry_offset_only');
feh_stop();

feh_start(
	'--caption-path .tc',
	'test/bg/exact/in'
+570 B

File added.

No diff preview for this file type.