From 313c8897096a9f04f4051a0a359bfbff58a3e0b4 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Wed, 30 Aug 2000 16:57:16 +0000 Subject: [PATCH] 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 --- src/Imlib2.h | 4 ++++ src/rgbadraw.c | 4 ++-- src/rgbadraw.h | 4 ---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Imlib2.h b/src/Imlib2.h index edfc7f3..893c576 100644 --- a/src/Imlib2.h +++ b/src/Imlib2.h @@ -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 */ diff --git a/src/rgbadraw.c b/src/rgbadraw.c index dd4d59a..74dbf63 100644 --- a/src/rgbadraw.c +++ b/src/rgbadraw.c @@ -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) { diff --git a/src/rgbadraw.h b/src/rgbadraw.h index db1418f..2ecb90b 100644 --- a/src/rgbadraw.h +++ b/src/rgbadraw.h @@ -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,