mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-03-15 20:50:42 +01:00
stroke(boxes): Apply user scale factors to dash segments
Fixes tests/rectilinear-dash-scale* Reported-by: Guillaume Ayoub <xovni@wanadoo.fr> Reported-by: Carlos Garcia Campos <carlosgc@gnome.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48818 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
5ff32f70c1
commit
70fc52cb80
1 changed files with 7 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue