From 70fc52cb80f21fff0ba960236f24b997692cce64 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 18 Apr 2012 15:24:41 +0100 Subject: [PATCH] stroke(boxes): Apply user scale factors to dash segments Fixes tests/rectilinear-dash-scale* Reported-by: Guillaume Ayoub Reported-by: Carlos Garcia Campos Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48818 Signed-off-by: Chris Wilson --- src/cairo-path-stroke-boxes.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cairo-path-stroke-boxes.c b/src/cairo-path-stroke-boxes.c index cc9dd195a..aca04c229 100644 --- a/src/cairo-path-stroke-boxes.c +++ b/src/cairo-path-stroke-boxes.c @@ -476,7 +476,7 @@ _cairo_rectilinear_stroker_line_to_dashed (void *closure, const cairo_point_t *a = &stroker->current_point; const cairo_point_t *b = point; cairo_bool_t fully_in_bounds; - double sign, remain; + double sf, sign, remain; cairo_fixed_t mag; cairo_status_t status; cairo_line_t segment; @@ -499,10 +499,13 @@ _cairo_rectilinear_stroker_line_to_dashed (void *closure, } is_horizontal = a->y == b->y; - if (is_horizontal) + if (is_horizontal) { mag = b->x - a->x; - else + sf = fabs (stroker->ctm->xx); + } else { mag = b->y - a->y; + sf = fabs (stroker->ctm->yy); + } if (mag < 0) { remain = _cairo_fixed_to_double (-mag); sign = 1.; @@ -515,7 +518,7 @@ _cairo_rectilinear_stroker_line_to_dashed (void *closure, while (remain > 0.) { double step_length; - step_length = MIN (stroker->dash.dash_remain, remain); + step_length = MIN (sf * stroker->dash.dash_remain, remain); remain -= step_length; mag = _cairo_fixed_from_double (sign*remain);