|
@@ -72,10 +72,10 @@ export default class LineService {
|
|
|
endPoint = uiService.getNewPositionForPop(endPoint);
|
|
|
let newLine = this.create(startPoint, endPoint, line.category);
|
|
|
newLine.setColor(line.color);
|
|
|
- if(line.weight){
|
|
|
+ if (line.weight) {
|
|
|
newLine.setWeight(line.weight);
|
|
|
}
|
|
|
- if(line.style){
|
|
|
+ if (line.style) {
|
|
|
newLine.setStyle(line.style);
|
|
|
}
|
|
|
return newLine;
|
|
@@ -151,6 +151,14 @@ export default class LineService {
|
|
|
dataService.addCurveLine(curveLine);
|
|
|
return curveLine;
|
|
|
}
|
|
|
+
|
|
|
+ addCPoint(position, index, vectorId) {
|
|
|
+ let curveLine = dataService.getCurveLine(vectorId);
|
|
|
+ let newPoint = curvePointService.create(position);
|
|
|
+ newPoint.setIndex(index);
|
|
|
+ curveLine.points.splice(index + 1, 0, newPoint);
|
|
|
+ curveLine.curves = mathUtil.getCurvesByPoints(curveLine.points);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const lineService = new LineService();
|