|
@@ -27,6 +27,7 @@ export default class MovePoint {
|
|
|
let msg = locationModeControl.beforeSetLocation();
|
|
|
if (msg != Msg.OK) {
|
|
|
uiService.prompt({ msg: msg, time: 1000 });
|
|
|
+ uiService.setSelectLocationMode(null);
|
|
|
return false;
|
|
|
} else {
|
|
|
point.x = position.x;
|
|
@@ -200,30 +201,33 @@ export default class MovePoint {
|
|
|
|
|
|
updateBasePoint(position, basePointId) {
|
|
|
let lineGeometry = dataService.getLine(Settings.baseLineId);
|
|
|
- let startPoint = dataService.getPoint(lineGeometry.startId);
|
|
|
- let endPoint = dataService.getPoint(lineGeometry.endId);
|
|
|
- lineGeometry = mathUtil.createLine1(startPoint, endPoint);
|
|
|
let basePoint = dataService.getPoint(basePointId);
|
|
|
- let parent = basePoint.getParent();
|
|
|
- for (let key in parent) {
|
|
|
- let line = dataService.getLine(key);
|
|
|
- if (line.getCategory() == VectorCategory.Line.LocationLineByBasePoint) {
|
|
|
- let otherPointId = line.getOtherPointId(basePointId);
|
|
|
- let otherPoint = dataService.getPoint(otherPointId);
|
|
|
- let otherLine = mathUtil.getLineForPoint(lineGeometry, otherPoint);
|
|
|
- line = mathUtil.createLine3(lineGeometry, position);
|
|
|
- let join = mathUtil.getIntersectionPoint(line, otherLine);
|
|
|
- mathUtil.clonePoint(otherPoint, join);
|
|
|
- } else if (
|
|
|
- line.getCategory() == VectorCategory.Line.ExtendedPositionLine
|
|
|
- ) {
|
|
|
- let otherPointId = line.getOtherPointId(basePointId);
|
|
|
- let otherPoint = dataService.getPoint(otherPointId);
|
|
|
- let otherLine = mathUtil.createLine3(lineGeometry, otherPoint);
|
|
|
- let join = mathUtil.getJoinLinePoint(position, otherLine);
|
|
|
- mathUtil.clonePoint(otherPoint, join);
|
|
|
+ if (lineGeometry) {
|
|
|
+ let startPoint = dataService.getPoint(lineGeometry.startId);
|
|
|
+ let endPoint = dataService.getPoint(lineGeometry.endId);
|
|
|
+ lineGeometry = mathUtil.createLine1(startPoint, endPoint);
|
|
|
+ let parent = basePoint.getParent();
|
|
|
+ for (let key in parent) {
|
|
|
+ let line = dataService.getLine(key);
|
|
|
+ if (line.getCategory() == VectorCategory.Line.LocationLineByBasePoint) {
|
|
|
+ let otherPointId = line.getOtherPointId(basePointId);
|
|
|
+ let otherPoint = dataService.getPoint(otherPointId);
|
|
|
+ let otherLine = mathUtil.getLineForPoint(lineGeometry, otherPoint);
|
|
|
+ line = mathUtil.createLine3(lineGeometry, position);
|
|
|
+ let join = mathUtil.getIntersectionPoint(line, otherLine);
|
|
|
+ mathUtil.clonePoint(otherPoint, join);
|
|
|
+ } else if (
|
|
|
+ line.getCategory() == VectorCategory.Line.ExtendedPositionLine
|
|
|
+ ) {
|
|
|
+ let otherPointId = line.getOtherPointId(basePointId);
|
|
|
+ let otherPoint = dataService.getPoint(otherPointId);
|
|
|
+ let otherLine = mathUtil.createLine3(lineGeometry, otherPoint);
|
|
|
+ let join = mathUtil.getJoinLinePoint(position, otherLine);
|
|
|
+ mathUtil.clonePoint(otherPoint, join);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
mathUtil.clonePoint(basePoint, position);
|
|
|
}
|
|
|
|