summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp1
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp37
-rw-r--r--editor/plugins/item_list_editor_plugin.cpp2
-rw-r--r--editor/project_manager.cpp1
5 files changed, 23 insertions, 20 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 0be0ea90a3..0ea8e04471 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -5079,6 +5079,7 @@ void EditorNode::_global_menu_action(const Variant &p_id, const Variant &p_meta)
if (id == GLOBAL_NEW_WINDOW) {
if (OS::get_singleton()->get_main_loop()) {
List<String> args;
+ args.push_back("-e");
String exec = OS::get_singleton()->get_executable_path();
OS::ProcessID pid = 0;
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 5b41da6e8e..5e69ce4e69 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -997,9 +997,9 @@ void AnimationPlayerEditor::_animation_duplicate() {
String new_name = current;
while (player->has_animation(new_name)) {
-
new_name = new_name + " (copy)";
}
+ new_anim->set_name(new_name);
undo_redo->create_action(TTR("Duplicate Animation"));
undo_redo->add_do_method(player, "add_animation", new_name, new_anim);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 89e25ffcff..e9a705a0dc 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3987,29 +3987,21 @@ void CanvasItemEditor::_update_scrollbars() {
updating_scroll = true;
- // Move the zoom buttons
+ // Move the zoom buttons.
Point2 controls_vb_begin = Point2(5, 5);
controls_vb_begin += (show_rulers) ? Point2(RULER_WIDTH, RULER_WIDTH) : Point2();
controls_vb->set_begin(controls_vb_begin);
- // Move and resize the scrollbars
- Size2 size = viewport->get_size();
Size2 hmin = h_scroll->get_minimum_size();
Size2 vmin = v_scroll->get_minimum_size();
- v_scroll->set_begin(Point2(size.width - vmin.width, (show_rulers) ? RULER_WIDTH : 0));
- v_scroll->set_end(Point2(size.width, size.height));
-
- h_scroll->set_begin(Point2((show_rulers) ? RULER_WIDTH : 0, size.height - hmin.height));
- h_scroll->set_end(Point2(size.width - vmin.width, size.height));
-
- // Get the visible frame
+ // Get the visible frame.
Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
Rect2 local_rect = Rect2(Point2(), viewport->get_size() - Size2(vmin.width, hmin.height));
_queue_update_bone_list();
- // Calculate scrollable area
+ // Calculate scrollable area.
Rect2 canvas_item_rect = Rect2(Point2(), screen_rect);
if (editor->get_edited_scene()) {
Rect2 content_rect = _get_encompassing_rect(editor->get_edited_scene());
@@ -4019,7 +4011,8 @@ void CanvasItemEditor::_update_scrollbars() {
canvas_item_rect.size += screen_rect * 2;
canvas_item_rect.position -= screen_rect;
- // Constraints the view offset and updates the scrollbars
+ // Constraints the view offset and updates the scrollbars.
+ Size2 size = viewport->get_size();
Point2 begin = canvas_item_rect.position;
Point2 end = canvas_item_rect.position + canvas_item_rect.size - local_rect.size / zoom;
bool constrain_editor_view = bool(EditorSettings::get_singleton()->get("editors/2d/constrain_editor_view"));
@@ -4066,7 +4059,13 @@ void CanvasItemEditor::_update_scrollbars() {
h_scroll->set_page(screen_rect.x);
}
- // Calculate scrollable area
+ // Move and resize the scrollbars, avoiding overlap.
+ v_scroll->set_begin(Point2(size.width - vmin.width, (show_rulers) ? RULER_WIDTH : 0));
+ v_scroll->set_end(Point2(size.width, size.height - (h_scroll->is_visible() ? hmin.height : 0)));
+ h_scroll->set_begin(Point2((show_rulers) ? RULER_WIDTH : 0, size.height - hmin.height));
+ h_scroll->set_end(Point2(size.width - (v_scroll->is_visible() ? vmin.width : 0), size.height));
+
+ // Calculate scrollable area.
v_scroll->set_value(view_offset.y);
h_scroll->set_value(view_offset.x);
@@ -4217,12 +4216,14 @@ void CanvasItemEditor::_zoom_on_position(float p_zoom, Point2 p_position) {
void CanvasItemEditor::_update_zoom_label() {
String zoom_text;
// The zoom level displayed is relative to the editor scale
- // (like in most image editors).
+ // (like in most image editors). Its lower bound is clamped to 1 as some people
+ // lower the editor scale to increase the available real estate,
+ // even if their display doesn't have a particularly low DPI.
if (zoom >= 10) {
// Don't show a decimal when the zoom level is higher than 1000 %.
- zoom_text = rtos(Math::round((zoom / EDSCALE) * 100)) + " %";
+ zoom_text = rtos(Math::round((zoom / MAX(1, EDSCALE)) * 100)) + " %";
} else {
- zoom_text = rtos(Math::stepify((zoom / EDSCALE) * 100, 0.1)) + " %";
+ zoom_text = rtos(Math::stepify((zoom / MAX(1, EDSCALE)) * 100, 0.1)) + " %";
}
zoom_reset->set_text(zoom_text);
@@ -4996,7 +4997,7 @@ Dictionary CanvasItemEditor::get_state() const {
Dictionary state;
// Take the editor scale into account.
- state["zoom"] = zoom / EDSCALE;
+ state["zoom"] = zoom / MAX(1, EDSCALE);
state["ofs"] = view_offset;
state["grid_offset"] = grid_offset;
state["grid_step"] = grid_step;
@@ -5251,7 +5252,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
show_rulers = true;
show_guides = true;
show_edit_locks = true;
- zoom = 1.0 / EDSCALE;
+ zoom = 1.0 / MAX(1, EDSCALE);
view_offset = Point2(-150 - RULER_WIDTH, -95 - RULER_WIDTH);
previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen
grid_offset = Point2();
diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp
index 39dc130f42..9f836ed0d3 100644
--- a/editor/plugins/item_list_editor_plugin.cpp
+++ b/editor/plugins/item_list_editor_plugin.cpp
@@ -302,7 +302,7 @@ void ItemListEditor::_delete_pressed() {
void ItemListEditor::_edit_items() {
- dialog->popup_centered(Vector2(300, 400) * EDSCALE);
+ dialog->popup_centered_clamped(Vector2(425, 1200) * EDSCALE, 0.8);
}
void ItemListEditor::edit(Node *p_item_list) {
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 0a904a42df..ca3431d3ec 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -1981,6 +1981,7 @@ void ProjectManager::_global_menu_action(const Variant &p_id, const Variant &p_m
int id = (int)p_id;
if (id == ProjectList::GLOBAL_NEW_WINDOW) {
List<String> args;
+ args.push_back("-p");
String exec = OS::get_singleton()->get_executable_path();
OS::ProcessID pid = 0;