Krolyxon
Commit 5a35484

Branches

Refs →

nsxiv5a35484

Align big images on top-left corner

Author
Bert
Date
2011-02-26 13:16 +0100
Parent
dafe7ea
Commit
5a35484e715d33763472ea473096a40b87ed126c

+9 −2

2 files changed

  1. M Makefile +1 −1
  2. M image.c +8 −1
M Makefile View
@@ -1,6 +1,6 @@
11 all: sxiv
22
3−VERSION=git-20110225
3+VERSION=git-20110226
44
55 CC?=gcc
66 PREFIX?=/usr/local
M image.c View
@@ -162,7 +162,14 @@ void img_render(img_t *img, win_t *win) {
162162 if (!img->re) {
163163 /* rendered for the first time */
164164 img->re = 1;
165− img_center(img, win);
165+ if (img->zoom * img->w <= win->w)
166+ img->x = (win->w - img->w * img->zoom) / 2;
167+ else
168+ img->x = 0;
169+ if (img->zoom * img->h <= win->h)
170+ img->y = (win->h - img->h * img->zoom) / 2;
171+ else
172+ img->y = 0;
166173 }
167174
168175 if (img->checkpan) {