Skip to content

Commit 8b7917f

Browse files
committed
Merge pull request #91073 from KoBeWi/irritating_bounds
Remove `uv_editor_bounds` editor setting
2 parents 504de8b + 6f7da2f commit 8b7917f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

editor/plugins/polygon_2d_editor_plugin.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ void Polygon2DEditor::_uv_edit_mode_select(int p_mode) {
293293
}
294294

295295
void Polygon2DEditor::_uv_edit_popup_hide() {
296-
EditorSettings::get_singleton()->set("interface/dialogs/uv_editor_bounds", Rect2(uv_edit->get_position(), uv_edit->get_size()));
297-
296+
EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "uv_editor", Rect2(uv_edit->get_position(), uv_edit->get_size()));
298297
_cancel_editing();
299298
}
300299

@@ -321,8 +320,9 @@ void Polygon2DEditor::_menu_option(int p_option) {
321320
undo_redo->commit_action();
322321
}
323322

324-
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/uv_editor_bounds")) {
325-
uv_edit->popup(EDITOR_GET("interface/dialogs/uv_editor_bounds"));
323+
const Rect2 bounds = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "uv_editor", Rect2());
324+
if (bounds.has_area()) {
325+
uv_edit->popup(bounds);
326326
} else {
327327
uv_edit->popup_centered_ratio(0.85);
328328
}
@@ -1308,6 +1308,7 @@ Polygon2DEditor::Polygon2DEditor() {
13081308
uv_edit = memnew(AcceptDialog);
13091309
add_child(uv_edit);
13101310
uv_edit->set_title(TTR("Polygon 2D UV Editor"));
1311+
uv_edit->connect("confirmed", callable_mp(this, &Polygon2DEditor::_uv_edit_popup_hide));
13111312
uv_edit->connect("canceled", callable_mp(this, &Polygon2DEditor::_uv_edit_popup_hide));
13121313

13131314
VBoxContainer *uv_main_vb = memnew(VBoxContainer);

0 commit comments

Comments
 (0)