diff options
author | Andrea Canciani <ranma42@gmail.com> | 2009-11-10 13:29:28 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2009-11-11 16:39:30 +0100 |
commit | e436a57c22f2c2a87404cac27e2d5e3c404f8bf9 (patch) | |
tree | fe526d6eca1c30722a301558da70486599cca135 /src/cairo-gstate.c | |
parent | b1a76394655793fd698a1281b00a3d049f9e70f5 (diff) |
Fix odd length dashing with negative offset
When computing an equivalent offset, a wrong total dash length was
used when the dash elements were odd and more than 1.
Doubling the total dash length whenever they are odd is needed to
correctly compute the new offset.
Fixes dash-offset.
Diffstat (limited to 'src/cairo-gstate.c')
-rw-r--r-- | src/cairo-gstate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index 86e20bc9..35934f9c 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -539,9 +539,9 @@ _cairo_gstate_set_dash (cairo_gstate_t *gstate, const double *dash, int num_dash if (dash_total == 0.0) return _cairo_error (CAIRO_STATUS_INVALID_DASH); - /* A single dash value indicate symmetric repeating, so the total + /* An odd dash value indicate symmetric repeating, so the total * is twice as long. */ - if (gstate->stroke_style.num_dashes == 1) + if (gstate->stroke_style.num_dashes & 1) dash_total *= 2; /* The dashing code doesn't like a negative offset, so we compute |