Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ static const keymap_t keys[] = {
{ 0, XK_equal, i_set_zoom, 100 },
{ 0, XK_w, i_fit_to_win, SCALE_DOWN },
{ 0, XK_W, i_fit_to_win, SCALE_FIT },
{ 0, XK_F, i_fit_to_win, SCALE_FILL },
{ 0, XK_e, i_fit_to_win, SCALE_WIDTH },
{ 0, XK_E, i_fit_to_win, SCALE_HEIGHT },
{ 0, XK_less, i_rotate, DEGREE_270 },
Expand Down
3 changes: 3 additions & 0 deletions image.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ bool img_fit(img_t *img)
zh = (float) img->win->h / (float) img->h;

switch (img->scalemode) {
case SCALE_FILL:
z = MAX(zw, zh);
break;
case SCALE_WIDTH:
z = zw;
break;
Expand Down
2 changes: 1 addition & 1 deletion options.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void parse_options(int argc, char **argv)
{
int n, opt;
char *end, *s;
const char *scalemodes = "dfwh";
const char *scalemodes = "dfFwh";

progname = strrchr(argv[0], '/');
progname = progname ? progname + 1 : argv[0];
Expand Down
5 changes: 4 additions & 1 deletion sxiv.1
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ may be a floating point number.
.TP
.BI "\-s " MODE
Set scale mode according to MODE character. Supported modes are: [d]own,
[f]it, [w]idth, [h]eight.
[f]it, [F]ill, [w]idth, [h]eight.
.TP
.B \-t
Start in thumbnail mode.
Expand Down Expand Up @@ -311,6 +311,9 @@ Set zoom level to 100%, but fit large images into window.
.B W
Fit image to window.
.TP
.B F
Fill image to window.
.TP
.B e
Fit image to window width.
.TP
Expand Down
1 change: 1 addition & 0 deletions sxiv.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ typedef enum {
typedef enum {
SCALE_DOWN,
SCALE_FIT,
SCALE_FILL,
SCALE_WIDTH,
SCALE_HEIGHT,
SCALE_ZOOM
Expand Down