summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp7
-rw-r--r--editor/editor_node.h1
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp53
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp1
4 files changed, 17 insertions, 45 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index f49c3829a3..90604a36f1 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1921,6 +1921,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
file->popup_centered_ratio();
} break;
+ case FILE_QUICK_OPEN: {
+
+ quick_open->popup_dialog("Resource", true);
+ quick_open->set_title(TTR("Quick Open..."));
+
+ } break;
case FILE_QUICK_OPEN_SCENE: {
quick_open->popup_dialog("PackedScene", true);
@@ -5695,6 +5701,7 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_submenu_item(TTR("Open Recent"), "RecentScenes", FILE_OPEN_RECENT);
p->add_separator();
+ p->add_shortcut(ED_SHORTCUT("editor/quick_open", TTR("Quick Open..."), KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_O), FILE_QUICK_OPEN);
p->add_shortcut(ED_SHORTCUT("editor/quick_open_scene", TTR("Quick Open Scene..."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCENE);
p->add_shortcut(ED_SHORTCUT("editor/quick_open_script", TTR("Quick Open Script..."), KEY_MASK_ALT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCRIPT);
p->add_separator();
diff --git a/editor/editor_node.h b/editor/editor_node.h
index cfe8bf9ec4..6e7b2b2443 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -146,6 +146,7 @@ private:
FILE_SAVE_OPTIMIZED,
FILE_OPEN_RECENT,
FILE_OPEN_OLD_SCENE,
+ FILE_QUICK_OPEN,
FILE_QUICK_OPEN_SCENE,
FILE_QUICK_OPEN_SCRIPT,
FILE_OPEN_PREV,
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 29a54f815d..772e47ac3a 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -760,7 +760,7 @@ void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p
r.position += (r.size + Vector2(spacing, spacing)) * offset;
}
Size2 sc = p_xform.get_scale();
-
+ Size2 cell_size = node->get_cell_size();
Rect2 rect = Rect2();
rect.position = node->map_to_world(p_point) + node->get_cell_draw_offset();
@@ -770,62 +770,25 @@ void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p
rect.size = r.size;
}
- if (rect.size.y > rect.size.x) {
- if ((p_flip_h && (p_flip_v || p_transpose)) || (p_flip_v && !p_transpose))
- tile_ofs.y += rect.size.y - rect.size.x;
- } else if (rect.size.y < rect.size.x) {
- if ((p_flip_v && (p_flip_h || p_transpose)) || (p_flip_h && !p_transpose))
- tile_ofs.x += rect.size.x - rect.size.y;
- }
-
if (p_transpose) {
SWAP(tile_ofs.x, tile_ofs.y);
+ rect.position.x += cell_size.x / 2 - rect.size.y / 2;
+ rect.position.y += cell_size.y / 2 - rect.size.x / 2;
+ } else {
+ rect.position += cell_size / 2 - rect.size / 2;
}
+
if (p_flip_h) {
sc.x *= -1.0;
tile_ofs.x *= -1.0;
}
+
if (p_flip_v) {
sc.y *= -1.0;
tile_ofs.y *= -1.0;
}
- if (node->get_tile_origin() == TileMap::TILE_ORIGIN_TOP_LEFT) {
-
- rect.position += tile_ofs;
- } else if (node->get_tile_origin() == TileMap::TILE_ORIGIN_BOTTOM_LEFT) {
- Size2 cell_size = node->get_cell_size();
-
- rect.position += tile_ofs;
-
- if (p_transpose) {
- if (p_flip_h)
- rect.position.x -= cell_size.x;
- else
- rect.position.x += cell_size.x;
- } else {
- if (p_flip_v)
- rect.position.y -= cell_size.y;
- else
- rect.position.y += cell_size.y;
- }
-
- } else if (node->get_tile_origin() == TileMap::TILE_ORIGIN_CENTER) {
- Size2 cell_size = node->get_cell_size();
-
- rect.position += tile_ofs;
-
- if (p_flip_h)
- rect.position.x -= cell_size.x / 2;
- else
- rect.position.x += cell_size.x / 2;
-
- if (p_flip_v)
- rect.position.y -= cell_size.y / 2;
- else
- rect.position.y += cell_size.y / 2;
- }
-
+ rect.position += tile_ofs;
rect.position = p_xform.xform(rect.position);
rect.size *= sc;
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index c2e847f211..a1b903576e 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -69,6 +69,7 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) {
}
}
visual_shader = Ref<VisualShader>(p_visual_shader);
+ visual_shader->set_graph_offset(graph->get_scroll_ofs() / EDSCALE);
} else {
visual_shader.unref();
}