Skip to content

Commit

Permalink
impl: locate - mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
gnlow committed Dec 29, 2023
1 parent 1f87aaf commit 395967f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,13 @@ export class Entry {
obj.emit("move")
}
locate(objId: string, obj: EntryContainer) {
if (objId == "mouse")
throw new Error("Unimplemented: locate to mouse")
obj.x = this.objects[objId].x
obj.y = this.objects[objId].y
if (objId == "mouse") {
obj.x = this.mouseX
obj.y = this.mouseY
} else {
obj.x = this.objects[objId].x
obj.y = this.objects[objId].y
}
obj.emit("move", obj)
}
rotate_relative(angle: number, obj: EntryContainer) {
Expand Down

0 comments on commit 395967f

Please sign in to comment.