|
@@ -217,38 +217,43 @@ export default class MovePoint {
|
|
|
|
|
|
updateFixPoint(position, fixPointId) {
|
|
updateFixPoint(position, fixPointId) {
|
|
let fixPoint = dataService.getPoint(fixPointId);
|
|
let fixPoint = dataService.getPoint(fixPointId);
|
|
- let basePoint = dataService.getPoint(fixPoint.linkedBasePointId);
|
|
|
|
|
|
+
|
|
let baseLine = dataService.getLine(Settings.baseLineId);
|
|
let baseLine = dataService.getLine(Settings.baseLineId);
|
|
- let startPoint = dataService.getPoint(baseLine.startId);
|
|
|
|
- let endPoint = dataService.getPoint(baseLine.endId);
|
|
|
|
|
|
+ if (baseLine) {
|
|
|
|
+ let startPoint = dataService.getPoint(baseLine.startId);
|
|
|
|
+ let endPoint = dataService.getPoint(baseLine.endId);
|
|
|
|
|
|
- let baseLineGeometry = mathUtil.createLine1(startPoint, endPoint);
|
|
|
|
- let vLine = mathUtil.getVerticalLine(baseLineGeometry, position);
|
|
|
|
- let join = mathUtil.getIntersectionPoint(baseLineGeometry, vLine);
|
|
|
|
|
|
+ let baseLineGeometry = mathUtil.createLine1(startPoint, endPoint);
|
|
|
|
+ let vLine = mathUtil.getVerticalLine(baseLineGeometry, position);
|
|
|
|
+ let join = mathUtil.getIntersectionPoint(baseLineGeometry, vLine);
|
|
|
|
|
|
- let parent = fixPoint.getParent();
|
|
|
|
- for (let key in parent) {
|
|
|
|
- let line = dataService.getLine(key);
|
|
|
|
- if (line.getCategory() == VectorCategory.Line.LocationLineByFixPoint) {
|
|
|
|
- let otherPointId = line.getOtherPointId(fixPointId);
|
|
|
|
- let otherPoint = dataService.getPoint(otherPointId);
|
|
|
|
- mathUtil.clonePoint(otherPoint, join);
|
|
|
|
- } else if (line.getCategory() == VectorCategory.Line.GuideLocationLine) {
|
|
|
|
- let otherPointId = line.getOtherPointId(fixPointId);
|
|
|
|
- let otherPoint = dataService.getPoint(otherPointId);
|
|
|
|
- let line2 = mathUtil.createLine3(baseLineGeometry, otherPoint);
|
|
|
|
- join = mathUtil.getIntersectionPoint(line2, vLine);
|
|
|
|
- mathUtil.clonePoint(otherPoint, join);
|
|
|
|
- } else if (
|
|
|
|
- line.getCategory() == VectorCategory.Line.ExtendedPositionLine
|
|
|
|
- ) {
|
|
|
|
- let otherPointId = line.getOtherPointId(fixPointId);
|
|
|
|
- let otherPoint = dataService.getPoint(otherPointId);
|
|
|
|
- let line2 = mathUtil.createLine3(baseLineGeometry, fixPoint);
|
|
|
|
- join = mathUtil.getJoinLinePoint(otherPoint, line2);
|
|
|
|
- mathUtil.clonePoint(otherPoint, join);
|
|
|
|
|
|
+ let parent = fixPoint.getParent();
|
|
|
|
+ for (let key in parent) {
|
|
|
|
+ let line = dataService.getLine(key);
|
|
|
|
+ if (line.getCategory() == VectorCategory.Line.LocationLineByFixPoint) {
|
|
|
|
+ let otherPointId = line.getOtherPointId(fixPointId);
|
|
|
|
+ let otherPoint = dataService.getPoint(otherPointId);
|
|
|
|
+ mathUtil.clonePoint(otherPoint, join);
|
|
|
|
+ } else if (
|
|
|
|
+ line.getCategory() == VectorCategory.Line.GuideLocationLine
|
|
|
|
+ ) {
|
|
|
|
+ let otherPointId = line.getOtherPointId(fixPointId);
|
|
|
|
+ let otherPoint = dataService.getPoint(otherPointId);
|
|
|
|
+ let line2 = mathUtil.createLine3(baseLineGeometry, otherPoint);
|
|
|
|
+ join = mathUtil.getIntersectionPoint(line2, vLine);
|
|
|
|
+ mathUtil.clonePoint(otherPoint, join);
|
|
|
|
+ } else if (
|
|
|
|
+ line.getCategory() == VectorCategory.Line.ExtendedPositionLine
|
|
|
|
+ ) {
|
|
|
|
+ let otherPointId = line.getOtherPointId(fixPointId);
|
|
|
|
+ let otherPoint = dataService.getPoint(otherPointId);
|
|
|
|
+ let line2 = mathUtil.createLine3(baseLineGeometry, fixPoint);
|
|
|
|
+ join = mathUtil.getJoinLinePoint(otherPoint, line2);
|
|
|
|
+ mathUtil.clonePoint(otherPoint, join);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
mathUtil.clonePoint(fixPoint, position);
|
|
mathUtil.clonePoint(fixPoint, position);
|
|
moveText.moveFullText(position, fixPoint.linkedTextId);
|
|
moveText.moveFullText(position, fixPoint.linkedTextId);
|
|
}
|
|
}
|