|
@@ -73,14 +73,21 @@ function drawTrack(
|
|
|
// circle
|
|
|
if (track.type === 'circle') {
|
|
|
const { x0, y0, x1, y1 } = track.option as DrawTrackCircleOption;
|
|
|
- gmObj.drawCircle(x0, y0, x1, y1).stroke(defaultColor, 2);
|
|
|
+ const rx = (x1 - x0) / 2;
|
|
|
+ const ry = (y1 - y0) / 2;
|
|
|
+ const cx = x0 + rx;
|
|
|
+ const cy = y0 + ry;
|
|
|
+ gmObj
|
|
|
+ .stroke(defaultColor, 2)
|
|
|
+ .fill('none')
|
|
|
+ .drawEllipse(cx, cy, cx, cy, 0, 360);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// line
|
|
|
if (track.type === 'line') {
|
|
|
const { x0, y0, x1, y1 } = track.option as DrawTrackLineOption;
|
|
|
- gmObj.drawLine(x0, y0, x1, y1).stroke(defaultColor, 2);
|
|
|
+ gmObj.stroke(defaultColor, 2).fill('none').drawLine(x0, y0, x1, y1);
|
|
|
}
|
|
|
});
|
|
|
|