Skip to content

Commit e0d0645

Browse files
authored
Merge pull request #1043 from Flamenco/hotfix_arc_no_move_to
Check for empty array before rendering arc
2 parents c83782f + 82dac14 commit e0d0645

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plugins/context2d.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,11 @@
932932
moves[moves.length - 1].deltas.push(delta);
933933
break;
934934
case 'arc':
935+
//TODO this was hack to avoid out-of-bounds issue
936+
// No move-to before drawing the arc
937+
if (moves.length == 0) {
938+
moves.push({start: {x: 0, y: 0}, deltas: [], abs: []});
939+
}
935940
moves[moves.length - 1].arc = true;
936941
moves[moves.length - 1].abs.push(pt);
937942
break;
@@ -1130,7 +1135,8 @@
11301135
moves[moves.length - 1].deltas.push(delta);
11311136
break;
11321137
case 'arc':
1133-
//TODO this was hack to avoid out of bounds issue
1138+
//TODO this was hack to avoid out-of-bounds issue
1139+
// No move-to before drawing the arc
11341140
if (moves.length == 0) {
11351141
moves.push({start: {x: 0, y: 0}, deltas: [], abs: []});
11361142
}

0 commit comments

Comments
 (0)