projects
/
geeqie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2bd6f7
)
fixed division by zero in pixbuf_renderer_get_scroll_center
author
Vladimir Nadvornik
<nadvornik@suse.cz>
Mon, 30 Jun 2008 21:08:28 +0000
(21:08 +0000)
committer
Vladimir Nadvornik
<nadvornik@suse.cz>
Mon, 30 Jun 2008 21:08:28 +0000
(21:08 +0000)
src/pixbuf-renderer.c
patch
|
blob
|
history
diff --git
a/src/pixbuf-renderer.c
b/src/pixbuf-renderer.c
index
8d64658
..
0f2198a
100644
(file)
--- a/
src/pixbuf-renderer.c
+++ b/
src/pixbuf-renderer.c
@@
-3525,8
+3525,15
@@
void pixbuf_renderer_get_scroll_center(PixbufRenderer *pr, gdouble *x, gdouble *
src_x = pr->x_scroll + pr->vis_width / 2;
src_y = pr->y_scroll + pr->vis_height / 2;
- *x = (gdouble)src_x / pr->width;
- *y = (gdouble)src_y / pr->height;
+ if (pr->width)
+ *x = (gdouble)src_x / pr->width;
+ else
+ *x = 0.5; /* center */
+
+ if (pr->height)
+ *y = (gdouble)src_y / pr->height;
+ else
+ *y = 0.5; /* center */
}
void pixbuf_renderer_set_scroll_center(PixbufRenderer *pr, gdouble x, gdouble y)