Skip to content

Commit

Permalink
Merge pull request #20414 from marcelofg55/bucket_fill_fix
Browse files Browse the repository at this point in the history
Fixed Bucket Fill tool
  • Loading branch information
akien-mga authored Jul 24, 2018
2 parents 9377f8d + ff95bbc commit cf297b4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions editor/plugins/tile_map_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand All @@ -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;
Expand Down

0 comments on commit cf297b4

Please sign in to comment.