summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2018-07-24 13:11:38 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2018-07-24 13:11:38 -0300
commitff95bbc6c47b9f24562add2766b238c4310b3cf5 (patch)
tree7e3d08b0fcd013dba01cde5f4dedc200c861b50c
parenteb38a61a6d5b205f149411dd9b737cd9426a910b (diff)
Fixed Bucket Fill tool
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 20158df5e8..484da3b4f3 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -538,9 +538,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
}
}
- Rect2i r = node->_edit_get_rect();
- r.position = r.position / node->get_cell_size();
- r.size = r.size / node->get_cell_size();
+ Rect2i r = node->get_used_rect();
int area = r.get_area();
if (preview) {
@@ -1029,7 +1027,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (points.size() == 0)
return false;
- undo_redo->create_action(TTR("Bucket Fill"));
+ _start_undo(TTR("Bucket Fill"));
Dictionary op;
op["id"] = get_selected_tiles();
@@ -1039,7 +1037,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
_fill_points(points, op);
- undo_redo->commit_action();
+ _finish_undo();
// We want to keep the bucket-tool active
return true;