summaryrefslogtreecommitdiff
path: root/src/cairo-bentley-ottmann-rectangular.c
diff options
context:
space:
mode:
authorTaekyun Kim <podain77@gmail.com>2011-06-15 23:23:02 +0900
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-15 16:13:15 +0100
commit8e7589abcc4075d4a1de9151e79fda5d093d03bb (patch)
tree38db22405052c62e9fe9324034806419e7c1d674 /src/cairo-bentley-ottmann-rectangular.c
parent3b9c8744898823a4b09917f0540a324318fef726 (diff)
downloadcairo-8e7589abcc4075d4a1de9151e79fda5d093d03bb.tar.gz
tessellator: Fixed to produce an output box with x1 <= x2 for single box input
Winding of a box is toggled by swapping x1, x2 coordinates. So we have to swap those coordinate rather than just copying. Many routines assume that boxes are left-top to right-bottom convention. So tessellator should produce such output boxes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-bentley-ottmann-rectangular.c')
-rw-r--r--src/cairo-bentley-ottmann-rectangular.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c
index 88986bb56..9a4dcd9f3 100644
--- a/src/cairo-bentley-ottmann-rectangular.c
+++ b/src/cairo-bentley-ottmann-rectangular.c
@@ -739,6 +739,13 @@ _cairo_bentley_ottmann_tessellate_boxes (const cairo_boxes_t *in,
if (unlikely (in->num_boxes == 1)) {
cairo_box_t box = in->chunks.base[0];
_cairo_boxes_clear (out);
+
+ if (box.p1.x > box.p2.x) {
+ cairo_fixed_t tmp = box.p1.x;
+ box.p1.x = box.p2.x;
+ box.p2.x = tmp;
+ }
+
status = _cairo_boxes_add (out, &box);
assert (status == CAIRO_STATUS_SUCCESS);
return CAIRO_STATUS_SUCCESS;