Skip to content

Commit

Permalink
Merge branch 'master' into feat/solidOptim
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha authored May 9, 2024
2 parents e4a19e5 + 4491d1e commit 184b369
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions lib/src/layer/misc/line_patterns/pixel_hiker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ class DottedPixelHiker extends _PixelHiker {
// side-effect of the last dot
if (!closePath) {
if (patternFit != PatternFit.none) {
final last = result.last;
if (last != offsets.last) {
if (result.isEmpty) {
addVisibleOffset(offsets.last);
} else {
final last = result.last;
if (last != offsets.last) {
addVisibleOffset(offsets.last);
}
}
}
}
Expand Down Expand Up @@ -157,9 +161,17 @@ class DashedPixelHiker extends _PixelHiker {
}
} else if (patternFit == PatternFit.extendFinalDash) {
final lastOffset = closePath ? offsets.first : offsets.last;
final lastVisible = result.last.end;
if (lastOffset != lastVisible) {
result.add(VisibleSegment(lastVisible, lastOffset));
if (result.isEmpty) {
if (offsets.length >= 2) {
final beforeLastOffset =
offsets[closePath ? offsets.length - 1 : offsets.length - 2];
result.add(VisibleSegment(beforeLastOffset, lastOffset));
}
} else {
final lastVisible = result.last.end;
if (lastOffset != lastVisible) {
result.add(VisibleSegment(lastVisible, lastOffset));
}
}
}
}
Expand Down

0 comments on commit 184b369

Please sign in to comment.