You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Don't show "Drawing rect" when not actually drawing
This commit is contained in:
@@ -800,6 +800,7 @@ void TileMapLayerEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p
|
||||
Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * edited_layer->get_global_transform_with_canvas();
|
||||
Vector2 mpos = edited_layer->get_local_mouse_position();
|
||||
Vector2i tile_shape_size = tile_set->get_tile_size();
|
||||
bool drawing_rect = false;
|
||||
|
||||
// Draw the selection.
|
||||
if ((tiles_bottom_panel->is_visible_in_tree() || patterns_bottom_panel->is_visible_in_tree()) && tool_buttons_group->get_pressed_button() == select_tool_button) {
|
||||
@@ -893,6 +894,7 @@ void TileMapLayerEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p
|
||||
} else if (drag_type == DRAG_TYPE_RECT) {
|
||||
// Preview for a rect pattern.
|
||||
preview = _draw_rect(tile_set->local_to_map(drag_start_mouse_pos), tile_set->local_to_map(mpos), drag_erasing);
|
||||
drawing_rect = !preview.is_empty();
|
||||
expand_grid = true;
|
||||
} else if (tool_buttons_group->get_pressed_button() == bucket_tool_button && drag_type == DRAG_TYPE_NONE) {
|
||||
// Preview for a fill pattern.
|
||||
@@ -1003,7 +1005,7 @@ void TileMapLayerEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p
|
||||
Point2 msgpos = Point2(20 * EDSCALE, p_overlay->get_size().y - 20 * EDSCALE);
|
||||
|
||||
String text = tile_set->local_to_map(edited_layer->get_local_mouse_position());
|
||||
if (drag_type == DRAG_TYPE_RECT) {
|
||||
if (drawing_rect) {
|
||||
Vector2i size = tile_set->local_to_map(edited_layer->get_local_mouse_position()) - tile_set->local_to_map(drag_start_mouse_pos);
|
||||
text += vformat(" %s (%dx%d)", TTR("Drawing Rect:"), ABS(size.x) + 1, ABS(size.y) + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user