forked from old/legacy-imlib2
The line clipping function is quite useful, so I made it public.
Sometimes it's handy to work out where your line was/would be drawn. int imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin, int ymax, int *clip_x0, int *clip_y0, int *clip_x1, int *clip_y1); SVN revision: 3277
This commit is contained in:
parent
e423fc372d
commit
313c889709
|
@ -228,6 +228,10 @@ void imlib_reset_color_modifier(void);
|
||||||
void imlib_apply_color_modifier(void);
|
void imlib_apply_color_modifier(void);
|
||||||
void imlib_apply_color_modifier_to_rectangle(int x, int y, int width, int height);
|
void imlib_apply_color_modifier_to_rectangle(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
int
|
||||||
|
imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin,
|
||||||
|
int ymax, int *clip_x0, int *clip_y0, int *clip_x1,
|
||||||
|
int *clip_y1);
|
||||||
Imlib_Updates imlib_image_draw_line(int x1, int y1, int x2, int y2, char make_updates);
|
Imlib_Updates imlib_image_draw_line(int x1, int y1, int x2, int y2, char make_updates);
|
||||||
/* draw line clipped into rectangle - results in no draw if line is not inside
|
/* draw line clipped into rectangle - results in no draw if line is not inside
|
||||||
* rectangle */
|
* rectangle */
|
||||||
|
|
|
@ -1530,7 +1530,7 @@ __imlib_draw_line_clipped(ImlibImage * im, int x1, int y1, int x2, int y2,
|
||||||
{
|
{
|
||||||
int cx0, cx1, cy0, cy1;
|
int cx0, cx1, cy0, cy1;
|
||||||
|
|
||||||
if (__imlib_clip_line
|
if (imlib_clip_line
|
||||||
(x1, y1, x2, y2, clip_xmin, clip_xmax, clip_ymin, clip_ymax, &cx0, &cy0,
|
(x1, y1, x2, y2, clip_xmin, clip_xmax, clip_ymin, clip_ymax, &cx0, &cy0,
|
||||||
&cx1, &cy1))
|
&cx1, &cy1))
|
||||||
{
|
{
|
||||||
|
@ -1542,7 +1542,7 @@ __imlib_draw_line_clipped(ImlibImage * im, int x1, int y1, int x2, int y2,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin,
|
imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin,
|
||||||
int ymax, int *clip_x0, int *clip_y0, int *clip_x1,
|
int ymax, int *clip_x0, int *clip_y0, int *clip_x1,
|
||||||
int *clip_y1)
|
int *clip_y1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,10 +24,6 @@ void __imlib_copy_image_data(ImlibImage *im, int x, int y, int w, int h, int nx,
|
||||||
void __imlib_copy_alpha_data(ImlibImage *src, ImlibImage *dst, int x, int y, int w, int h, int nx, int ny);
|
void __imlib_copy_alpha_data(ImlibImage *src, ImlibImage *dst, int x, int y, int w, int h, int nx, int ny);
|
||||||
ImlibOutCode __imlib_comp_outcode(double x, double y, double xmin, double xmax,
|
ImlibOutCode __imlib_comp_outcode(double x, double y, double xmin, double xmax,
|
||||||
double ymin, double ymax);
|
double ymin, double ymax);
|
||||||
int
|
|
||||||
__imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin,
|
|
||||||
int ymax, int *clip_x0, int *clip_y0, int *clip_x1,
|
|
||||||
int *clip_y1);
|
|
||||||
ImlibUpdate *
|
ImlibUpdate *
|
||||||
__imlib_draw_line_clipped(ImlibImage * im, int x1, int y1, int x2, int y2,
|
__imlib_draw_line_clipped(ImlibImage * im, int x1, int y1, int x2, int y2,
|
||||||
int clip_xmin, int clip_xmax, int clip_ymin,
|
int clip_xmin, int clip_xmax, int clip_ymin,
|
||||||
|
|
Loading…
Reference in New Issue