|
@@ -11,6 +11,7 @@ import { roadPointService } from "../Service/RoadPointService";
|
|
import { lineService } from "../Service/LineService";
|
|
import { lineService } from "../Service/LineService";
|
|
import { circleService } from "../Service/CircleService";
|
|
import { circleService } from "../Service/CircleService";
|
|
import { pointService } from "../Service/PointService";
|
|
import { pointService } from "../Service/PointService";
|
|
|
|
+import { magnifierService } from "../Service/MagnifierService";
|
|
|
|
|
|
export default class History {
|
|
export default class History {
|
|
constructor(layer) {
|
|
constructor(layer) {
|
|
@@ -96,6 +97,7 @@ export default class History {
|
|
this.goPreForLines(item.lines);
|
|
this.goPreForLines(item.lines);
|
|
this.goPreForCircles(item.circles);
|
|
this.goPreForCircles(item.circles);
|
|
this.goPreForTexts(item.texts);
|
|
this.goPreForTexts(item.texts);
|
|
|
|
+ this.goPreForMagnifiers(item.magnifiers);
|
|
this.goPreForSVGs(item.svgs);
|
|
this.goPreForSVGs(item.svgs);
|
|
historyService.undoHistoryRecord();
|
|
historyService.undoHistoryRecord();
|
|
change.saveCurrentInfo();
|
|
change.saveCurrentInfo();
|
|
@@ -184,6 +186,28 @@ export default class History {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ goPreForMagnifiers(itemForMagnifiers) {
|
|
|
|
+ for (let i = 0; i < itemForMagnifiers.length; ++i) {
|
|
|
|
+ const item = itemForMagnifiers[i];
|
|
|
|
+ if (item.handle == HistoryEvents.AddMagnifier) {
|
|
|
|
+ dataService.deleteMagnifier(item.magnifier.id);
|
|
|
|
+ } else if (item.handle == HistoryEvents.DeleteMagnifier) {
|
|
|
|
+ let newMagnifier = magnifierService.create(
|
|
|
|
+ item.magnifier.position,
|
|
|
|
+ item.magnifier.id
|
|
|
|
+ );
|
|
|
|
+ historyUtil.assignMagnifierFromMagnifier(newMagnifier, item.magnifier);
|
|
|
|
+ } else if (item.handle == HistoryEvents.ModifyMagnifier) {
|
|
|
|
+ const preMagnifier = item.preMagnifier;
|
|
|
|
+ let currentMagnifier = dataService.getMagnifier(item.curMagnifier.id);
|
|
|
|
+ historyUtil.assignMagnifierFromMagnifier(
|
|
|
|
+ currentMagnifier,
|
|
|
|
+ preMagnifier
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
goPreForSVGs(itemForSVGs) {
|
|
goPreForSVGs(itemForSVGs) {
|
|
for (let i = 0; i < itemForSVGs.length; ++i) {
|
|
for (let i = 0; i < itemForSVGs.length; ++i) {
|
|
const item = itemForSVGs[i];
|
|
const item = itemForSVGs[i];
|
|
@@ -279,6 +303,28 @@ export default class History {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ goNextForMagnifiers(itemForMagnifiers) {
|
|
|
|
+ for (let i = 0; i < itemForMagnifiers.length; ++i) {
|
|
|
|
+ const item = itemForMagnifiers[i];
|
|
|
|
+ if (item.handle == HistoryEvents.AddMagnifier) {
|
|
|
|
+ let vMagnifier = magnifierService.create(
|
|
|
|
+ item.magnifier.position,
|
|
|
|
+ item.magnifier.id
|
|
|
|
+ );
|
|
|
|
+ historyUtil.assignMagnifierFromMagnifier(vMagnifier, item.magnifier);
|
|
|
|
+ } else if (item.handle == HistoryEvents.DeleteMagnifier) {
|
|
|
|
+ dataService.deleteMagnifier(item.magnifier.id);
|
|
|
|
+ } else if (item.handle == HistoryEvents.ModifyMagnifier) {
|
|
|
|
+ const currentMagnifier = item.curMagnifier;
|
|
|
|
+ let preMagnifier = dataService.getMagnifier(item.curMagnifier.id);
|
|
|
|
+ historyUtil.assignMagnifierFromMagnifier(
|
|
|
|
+ preMagnifier,
|
|
|
|
+ currentMagnifier
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
goNextForSVGs(itemForSVGs) {
|
|
goNextForSVGs(itemForSVGs) {
|
|
for (let i = 0; i < itemForSVGs.length; ++i) {
|
|
for (let i = 0; i < itemForSVGs.length; ++i) {
|
|
const item = itemForSVGs[i];
|
|
const item = itemForSVGs[i];
|
|
@@ -306,6 +352,7 @@ export default class History {
|
|
this.goNextForLines(item.lines);
|
|
this.goNextForLines(item.lines);
|
|
this.goNextForCircles(item.circles);
|
|
this.goNextForCircles(item.circles);
|
|
this.goNextForTexts(item.texts);
|
|
this.goNextForTexts(item.texts);
|
|
|
|
+ this.goNextForMagnifiers(item.magnifiers);
|
|
this.goNextForSVGs(item.svgs);
|
|
this.goNextForSVGs(item.svgs);
|
|
change.saveCurrentInfo();
|
|
change.saveCurrentInfo();
|
|
this.setState();
|
|
this.setState();
|