Fix position of popups in LayeredTileSetAtlasSourceEditor.

This commit is contained in:
Relintai 2024-03-11 15:40:43 +01:00
parent fd5ed33a7b
commit d38e9256b6

View File

@ -1574,12 +1574,14 @@ void LayeredTileSetAtlasSourceEditor::_end_dragging() {
// We have a tile.
menu_option_coords = selected.tile;
menu_option_alternative = 0;
base_tile_popup_menu->popup(Rect2i(get_global_transform().xform(get_local_mouse_position()), Size2i()));
base_tile_popup_menu->set_position(get_global_transform().xform(get_local_mouse_position()));
base_tile_popup_menu->popup();
} else if (hovered_base_tile_coords != LayeredTileSetSource::INVALID_ATLAS_COORDS) {
// We don't have a tile, but can create one.
menu_option_coords = hovered_base_tile_coords;
menu_option_alternative = LayeredTileSetSource::INVALID_TILE_ALTERNATIVE;
empty_base_tile_popup_menu->popup(Rect2i(get_global_transform().xform(get_local_mouse_position()), Size2i()));
empty_base_tile_popup_menu->set_position(get_global_transform().xform(get_local_mouse_position()));
empty_base_tile_popup_menu->popup();
}
} break;
case DRAG_TYPE_RESIZE_TOP_LEFT: