[nostalgia/core/studio] Fix TileSheetEditor not to display context menu when right click is not on tile
This commit is contained in:
parent
53358d2e03
commit
5c5c62dc55
@ -23,7 +23,10 @@ Rectangle {
|
||||
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var tile = mouseArea.tileAt(mouseX, mouseY);
|
||||
if (tile) {
|
||||
contextMenu.popup();
|
||||
}
|
||||
} else {
|
||||
contextMenu.dismiss();
|
||||
}
|
||||
@ -92,9 +95,11 @@ Rectangle {
|
||||
text: "Insert Tile"
|
||||
onTriggered: {
|
||||
var tile = mouseArea.tileAt(contextMenu.x, contextMenu.y);
|
||||
if (tile) {
|
||||
sheetData.insertTileCmd(tile.tileNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: "Delete Tile"
|
||||
|
Loading…
Reference in New Issue
Block a user