fix:set editor zone method

pr675
Hufe921 3 years ago
parent c0fee3ea14
commit 9de29ed934

@ -1,10 +1,13 @@
import { EditorZone } from '../../dataset/enum/Editor' import { EditorZone } from '../../dataset/enum/Editor'
import { Draw } from '../draw/Draw'
export class Zone { export class Zone {
private draw: Draw
private currentZone: EditorZone private currentZone: EditorZone
constructor() { constructor(draw: Draw) {
this.draw = draw
this.currentZone = EditorZone.MAIN this.currentZone = EditorZone.MAIN
} }
@ -21,7 +24,14 @@ export class Zone {
} }
public setZone(payload: EditorZone) { public setZone(payload: EditorZone) {
if (this.currentZone === payload) return
this.currentZone = payload this.currentZone = payload
this.draw.getRange().clearRange()
this.draw.render({
isSubmitHistory: false,
isSetCursor: false,
isCompute: false
})
} }
} }
Loading…
Cancel
Save