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 <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Uli Schlachter 2009-08-09 15:16:44 +02:00 committed by Julien Danjou
parent 8165a3b483
commit 2d15a67f25
1 changed files with 0 additions and 18 deletions

18
image.c
View File

@ -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);