Skip to content

Commit

Permalink
Merge pull request #80968 from rakkarage/alternative-icon-scale
Browse files Browse the repository at this point in the history
Call `add_child` after `set_rect` to fix size bug
  • Loading branch information
YuriSizov committed Aug 25, 2023
2 parents b6c4efe + e93d2a0 commit 6da4ad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/plugins/tiles/tile_set_atlas_source_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {

// Create and position the button.
Button *button = memnew(Button);
alternative_tiles_control->add_child(button);
button->set_flat(true);
button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
button->add_theme_style_override("normal", memnew(StyleBoxEmpty));
Expand All @@ -1000,6 +999,7 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {
button->connect("pressed", callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile).bind(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE));
button->set_rect(Rect2(Vector2(pos.x, pos.y + (y_increment - texture_region_base_size.y) / 2.0), Vector2(texture_region_base_size_min, texture_region_base_size_min)));
button->set_expand_icon(true);
alternative_tiles_control->add_child(button);

pos.y += y_increment;
}
Expand Down

0 comments on commit 6da4ad1

Please sign in to comment.