From 6924fc525d6bc82901cfed769c176b44c0bce024 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 11 May 2012 14:04:09 +0100 Subject: [PATCH] sna: Fix off-by-one in computation of width for inplace trapezoids This lead to the dropping of the last pixel for small area trapezoids, such as the right hand outline of buttons under ClearLooks. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48320 Signed-off-by: Chris Wilson --- src/sna/sna_trapezoids.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 120e7550..c06c29dd 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -1581,11 +1581,11 @@ inplace_subrow(struct active_list *active, int8_t *row, if (xstart < FAST_SAMPLES_X * width) { FAST_SAMPLES_X_TO_INT_FRAC(xstart, ix, fx); row[ix] -= FAST_SAMPLES_X - fx; - if (fx && ix + 1< width) + if (fx && ix + 1 < width) row[++ix] -= fx; - if (ix > *max) - *max = ix; + if (ix >= *max) + *max = ix + 1; xstart = INT_MIN; } else @@ -1622,6 +1622,7 @@ inplace_subrow(struct active_list *active, int8_t *row, } else { edge->prev->next = next; next->prev = edge->prev; + active->min_height = -1; } edge = next;