diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-08-22 22:26:00 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-08-22 22:26:00 +0100 |
commit | 4357f5e9d72b0f4efe939e02a7012fc60d43095d (patch) | |
tree | 07c3aa6577f1d1adb3a6a2c9b470f53bda875d3b /gtk/plotters.c | |
parent | 37d148f4d790cdfb756ea6348a15da8c3d75fdff (diff) | |
download | netsurf-4357f5e9d72b0f4efe939e02a7012fc60d43095d.tar.gz netsurf-4357f5e9d72b0f4efe939e02a7012fc60d43095d.tar.bz2 |
Test for zero width/height at the start.
Diffstat (limited to 'gtk/plotters.c')
-rw-r--r-- | gtk/plotters.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/plotters.c b/gtk/plotters.c index 2f2b111db..fbf3d58ac 100644 --- a/gtk/plotters.c +++ b/gtk/plotters.c @@ -404,6 +404,11 @@ static bool nsgtk_plot_bitmap(int x, int y, int width, int height, bool repeat_x = (flags & BITMAPF_REPEAT_X); bool repeat_y = (flags & BITMAPF_REPEAT_Y); + /* Bail early if we can */ + if (width == 0 || height == 0) + /* Nothing to plot */ + return true; + if (!(repeat_x || repeat_y)) { /* Not repeating at all, so just pass it on */ return nsgtk_plot_pixbuf(x, y, width, height, bitmap, bg); @@ -412,11 +417,6 @@ static bool nsgtk_plot_bitmap(int x, int y, int width, int height, width = bitmap_get_width(bitmap); height = bitmap_get_height(bitmap); - /* Bail early if we can */ - if (width == 0 || height == 0) - /* Nothing to plot */ - return true; - if (y > cliprect.y) { doneheight = (cliprect.y - height) + ((y - cliprect.y) % height); } else { |