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:
Tom Gilbert 2000-08-30 16:57:16 +00:00
parent e423fc372d
commit 313c889709
3 changed files with 6 additions and 6 deletions

View File

@ -228,6 +228,10 @@ void imlib_reset_color_modifier(void);
void imlib_apply_color_modifier(void);
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);
/* draw line clipped into rectangle - results in no draw if line is not inside
* rectangle */

View File

@ -1530,7 +1530,7 @@ __imlib_draw_line_clipped(ImlibImage * im, int x1, int y1, int x2, int y2,
{
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,
&cx1, &cy1))
{
@ -1542,7 +1542,7 @@ __imlib_draw_line_clipped(ImlibImage * im, int x1, int y1, int x2, int y2,
}
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 *clip_y1)
{

View File

@ -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);
ImlibOutCode __imlib_comp_outcode(double x, double y, double xmin, double xmax,
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 *
__imlib_draw_line_clipped(ImlibImage * im, int x1, int y1, int x2, int y2,
int clip_xmin, int clip_xmax, int clip_ymin,