Skip to content

Commit

Permalink
Merge pull request #93747 from KoBeWi/layer_of_bugs
Browse files Browse the repository at this point in the history
Fix some TileMapLayer editing problems
  • Loading branch information
akien-mga committed Jun 29, 2024
2 parents 2f7973f + 92b0375 commit 4ab8fb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions editor/plugins/tiles/tile_map_layer_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,13 @@ bool TileMapLayerEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEven
}

} else {
// Released
_stop_dragging();
// Released.
drag_erasing = false;
if (drag_type == DRAG_TYPE_NONE) {
return false;
} else {
_stop_dragging();
}
}

CanvasItemEditor::get_singleton()->update_viewport();
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/tile_map_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ void TileMapLayer::_update_self_texture_repeat(RS::CanvasItemTextureRepeat p_tex

#ifdef TOOLS_ENABLED
bool TileMapLayer::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
return get_cell_source_id(local_to_map(p_point)) != TileSet::INVALID_SOURCE;
return tile_set.is_valid() && get_cell_source_id(local_to_map(p_point)) != TileSet::INVALID_SOURCE;
}
#endif

Expand Down

0 comments on commit 4ab8fb8

Please sign in to comment.