From 2d15a67f25c4049369ac01d772296a633637e65d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 9 Aug 2009 15:16:44 +0200 Subject: [PATCH] Image: Allow objects to be drawn outside of the image At least for circles it's really useful to be allowed to draw a circle which is only partly inside the image. For the other drawing functions there should be no reason why this shouldn't be allowed. Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- image.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/image.c b/image.c index 02b503f9..42f65d78 100644 --- a/image.c +++ b/image.c @@ -513,9 +513,6 @@ luaA_image_draw_line(lua_State *L) imlib_context_set_image(image->image); color_init_reply(cookie); - if((MAX(x1,x2) > imlib_image_get_width()) || (MAX(y1,y2) > imlib_image_get_height())) - return 0; - imlib_context_set_color(color.red, color.green, color.blue, color.alpha); imlib_image_draw_line(x1, y1, x2, y2, 0); image->isupdated = false; @@ -551,11 +548,6 @@ luaA_image_draw_rectangle(lua_State *L) imlib_context_set_image(image->image); color_init_reply(cookie); - if((x > imlib_image_get_width()) || (x + width > imlib_image_get_width())) - return 0; - if((y > imlib_image_get_height()) || (y + height > imlib_image_get_height())) - return 0; - imlib_context_set_color(color.red, color.green, color.blue, color.alpha); if(!fill) imlib_image_draw_rectangle(x, y, width, height); @@ -639,11 +631,6 @@ luaA_image_draw_rectangle_gradient(lua_State *L) luaA_checktable(L, 6); double angle = luaL_checknumber(L, 7); - if((x > imlib_image_get_width()) || (x + width > imlib_image_get_width())) - return 0; - if((y > imlib_image_get_height()) || (y + height > imlib_image_get_height())) - return 0; - imlib_context_set_image(image->image); luaA_table_to_color_range(L, 6); @@ -686,11 +673,6 @@ luaA_image_draw_circle(lua_State *L) imlib_context_set_image(image->image); color_init_reply(cookie); - if((x > imlib_image_get_width()) || (x + ah > imlib_image_get_width()) || (x - ah < 0)) - return 0; - if((y > imlib_image_get_height()) || (y + av > imlib_image_get_height()) || (y - av < 0)) - return 0; - imlib_context_set_color(color.red, color.green, color.blue, color.alpha); if(!fill) imlib_image_draw_ellipse(x, y, ah, av);