Skip to content

Commit

Permalink
fix:set editor zone method
Browse files Browse the repository at this point in the history
  • Loading branch information
Hufe921 committed Mar 19, 2023
1 parent c0fee3e commit 9de29ed
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/editor/core/zone/Zone.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { EditorZone } from '../../dataset/enum/Editor'
import { Draw } from '../draw/Draw'

export class Zone {

private draw: Draw
private currentZone: EditorZone

constructor() {
constructor(draw: Draw) {
this.draw = draw
this.currentZone = EditorZone.MAIN
}

Expand All @@ -21,7 +24,14 @@ export class Zone {
}

public setZone(payload: EditorZone) {
if (this.currentZone === payload) return
this.currentZone = payload
this.draw.getRange().clearRange()
this.draw.render({
isSubmitHistory: false,
isSetCursor: false,
isCompute: false
})
}

}

0 comments on commit 9de29ed

Please sign in to comment.