Trash button only shows up on sheet page
This commit is contained in:
parent
cc03a0e765
commit
87d3e6fc9b
@ -32,6 +32,9 @@ const makeTabButton = (tabname: TabName | "sheet", x: number, y: number, icon: A
|
||||
const makeTrashButton = (x: number, y: number, icon: Array<number>) => {
|
||||
buttons.push({
|
||||
update() {
|
||||
if (page.tab !== "sheet") {
|
||||
return
|
||||
}
|
||||
if (mouseClick()) {
|
||||
const {x: mouseX, y: mouseY} = mousePos();
|
||||
if (inRect(mouseX, mouseY, x, y, 8, 8)) {
|
||||
@ -41,6 +44,9 @@ const makeTrashButton = (x: number, y: number, icon: Array<number>) => {
|
||||
}
|
||||
},
|
||||
draw() {
|
||||
if (page.tab !== "sheet") {
|
||||
return
|
||||
}
|
||||
drawIcon(x, y, icon, COLOR.BLACK);
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user