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:
parent
8165a3b483
commit
2d15a67f25
18
image.c
18
image.c
|
@ -513,9 +513,6 @@ luaA_image_draw_line(lua_State *L)
|
||||||
imlib_context_set_image(image->image);
|
imlib_context_set_image(image->image);
|
||||||
color_init_reply(cookie);
|
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_context_set_color(color.red, color.green, color.blue, color.alpha);
|
||||||
imlib_image_draw_line(x1, y1, x2, y2, 0);
|
imlib_image_draw_line(x1, y1, x2, y2, 0);
|
||||||
image->isupdated = false;
|
image->isupdated = false;
|
||||||
|
@ -551,11 +548,6 @@ luaA_image_draw_rectangle(lua_State *L)
|
||||||
imlib_context_set_image(image->image);
|
imlib_context_set_image(image->image);
|
||||||
color_init_reply(cookie);
|
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);
|
imlib_context_set_color(color.red, color.green, color.blue, color.alpha);
|
||||||
if(!fill)
|
if(!fill)
|
||||||
imlib_image_draw_rectangle(x, y, width, height);
|
imlib_image_draw_rectangle(x, y, width, height);
|
||||||
|
@ -639,11 +631,6 @@ luaA_image_draw_rectangle_gradient(lua_State *L)
|
||||||
luaA_checktable(L, 6);
|
luaA_checktable(L, 6);
|
||||||
double angle = luaL_checknumber(L, 7);
|
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);
|
imlib_context_set_image(image->image);
|
||||||
|
|
||||||
luaA_table_to_color_range(L, 6);
|
luaA_table_to_color_range(L, 6);
|
||||||
|
@ -686,11 +673,6 @@ luaA_image_draw_circle(lua_State *L)
|
||||||
imlib_context_set_image(image->image);
|
imlib_context_set_image(image->image);
|
||||||
color_init_reply(cookie);
|
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);
|
imlib_context_set_color(color.red, color.green, color.blue, color.alpha);
|
||||||
if(!fill)
|
if(!fill)
|
||||||
imlib_image_draw_ellipse(x, y, ah, av);
|
imlib_image_draw_ellipse(x, y, ah, av);
|
||||||
|
|
Loading…
Reference in New Issue