<div dir="ltr">Looks like a good idea to me.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 30, 2016 at 8:45 AM, Enrico Weigelt, metux IT consult <span dir="ltr"><<a href="mailto:enrico.weigelt@gr13.net" target="_blank">enrico.weigelt@gr13.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Enrico Weigelt, metux IT consult <<a href="mailto:enrico.weigelt@gr13.net">enrico.weigelt@gr13.net</a>><br>
---<br>
src/cairo-box-inline.h | 10 ++++++++++<br>
src/cairo-clip-boxes.c | 11 ++---------<br>
2 files changed, 12 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/src/cairo-box-inline.h b/src/cairo-box-inline.h<br>
index 406102a..c20c28f 100644<br>
--- a/src/cairo-box-inline.h<br>
+++ b/src/cairo-box-inline.h<br>
@@ -57,6 +57,16 @@ _cairo_box_from_integers (cairo_box_t *box, int x, int y, int w, int h)<br>
box->p2.y = _cairo_fixed_from_int (y + h);<br>
}<br>
<br>
+static inline void<br>
+_cairo_box_from_rectangle_int(cairo_box_t *box,<br>
+ const cairo_rectangle_int_t *rect)<br>
+{<br>
+ box->p1.x = _cairo_fixed_from_int (rect->x);<br>
+ box->p1.y = _cairo_fixed_from_int (rect->y);<br>
+ box->p2.x = _cairo_fixed_from_int (rect->x + rect->width);<br>
+ box->p2.y = _cairo_fixed_from_int (rect->y + rect->height);<br>
+}<br>
+<br>
/* assumes box->p1 is top-left, p2 bottom-right */<br>
static inline void<br>
_cairo_box_add_point (cairo_box_t *box,<br>
diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c<br>
index 7bcbeb1..abf634e 100644<br>
--- a/src/cairo-clip-boxes.c<br>
+++ b/src/cairo-clip-boxes.c<br>
@@ -119,11 +119,7 @@ _cairo_clip_contains_rectangle (const cairo_clip_t *clip,<br>
{<br>
cairo_box_t box;<br>
<br>
- box.p1.x = _cairo_fixed_from_int (rect->x);<br>
- box.p1.y = _cairo_fixed_from_int (rect->y);<br>
- box.p2.x = _cairo_fixed_from_int (rect->x + rect->width);<br>
- box.p2.y = _cairo_fixed_from_int (rect->y + rect->height);<br>
-<br>
+ _cairo_box_from_rectangle_int(&box, rect);<br>
return _cairo_clip_contains_rectangle_box (clip, rect, &box);<br>
}<br>
<br>
@@ -347,10 +343,7 @@ _cairo_clip_intersect_rectangle (cairo_clip_t *clip,<br>
if (r->width == 0 || r->height == 0)<br>
return _cairo_clip_set_all_clipped (clip);<br>
<br>
- box.p1.x = _cairo_fixed_from_int (r->x);<br>
- box.p1.y = _cairo_fixed_from_int (r->y);<br>
- box.p2.x = _cairo_fixed_from_int (r->x + r->width);<br>
- box.p2.y = _cairo_fixed_from_int (r->y + r->height);<br>
+ _cairo_box_from_rectangle_int(&box, r);<br>
<br>
return _cairo_clip_intersect_rectangle_box (clip, r, &box);<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.6.4.442.g545299f<br>
<br>
--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="https://lists.cairographics.org/mailman/listinfo/cairo" rel="noreferrer" target="_blank">https://lists.cairographics.org/mailman/listinfo/cairo</a></font></span></blockquote></div><br></div>