Skip to content

Commit

Permalink
tessellator bug fix: fill-missed-stop
Browse files Browse the repository at this point in the history
Fixes the regression exhibited by the test fill-missed-stop,
where the tessellator would sometimes extend a trapezoid
too far below the end of the right edge.
  • Loading branch information
M Joonas Pihlaja committed Dec 6, 2006
1 parent 614117e commit e6c8feb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cairo-bentley-ottmann.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,15 +1064,21 @@ _cairo_bo_edge_end_trap (cairo_bo_edge_t *left,
cairo_fixed_t fixed_top, fixed_bot;
cairo_status_t status = CAIRO_STATUS_SUCCESS;
cairo_bo_trap_t *trap = left->deferred_trap;
cairo_bo_edge_t *right;

if (!trap)
return CAIRO_STATUS_SUCCESS;

/* If the right edge of the trapezoid stopped earlier than the
* left edge, then cut the trapezoid bottom early. */
right = trap->right;
if (right->bottom.y < bot)
bot = right->bottom.y;

fixed_top = trap->top >> CAIRO_BO_GUARD_BITS;
fixed_bot = bot >> CAIRO_BO_GUARD_BITS;

if (fixed_top < fixed_bot) {
cairo_bo_edge_t *right = trap->right;
cairo_point_t left_top, left_bot, right_top, right_bot;

left_top.x = left->top.x >> CAIRO_BO_GUARD_BITS;
Expand Down

0 comments on commit e6c8feb

Please sign in to comment.