mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 00:38:06 +02:00
Fix skipping zero length dash segments in dash_start.
The extra check makes sure zero length segments are not skipped when computing the dash start state. This is needed so that we get proper line capping if, for example, the first dash segment has zero length and we have a dash offset of zero.
This commit is contained in:
parent
5eaf71e77b
commit
2078557c5c
1 changed files with 5 additions and 1 deletions
|
|
@ -116,7 +116,11 @@ _cairo_stroker_start_dash (cairo_stroker_t *stroker)
|
|||
int i = 0;
|
||||
|
||||
offset = stroker->style->dash_offset;
|
||||
while (offset >= stroker->style->dash[i]) {
|
||||
|
||||
/* We stop searching for a starting point as soon as the
|
||||
offset reaches zero. Otherwise when an initial dash
|
||||
segment shrinks to zero it will be skipped over. */
|
||||
while (offset > 0.0 && offset >= stroker->style->dash[i]) {
|
||||
offset -= stroker->style->dash[i];
|
||||
on = 1-on;
|
||||
if (++i == stroker->style->num_dashes)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue