summaryrefslogtreecommitdiff
path: root/editor/plugins/canvas_item_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index fe33a91a41..591dbeeaff 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2534,7 +2534,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
bool release_lmb = (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT); // Required to properly release some stuff (e.g. selection box) while panning.
- if (EditorSettings::get_singleton()->get("editors/panning/simple_panning") || !pan_pressed || release_lmb) {
+ if (EDITOR_GET("editors/panning/simple_panning") || !pan_pressed || release_lmb) {
accepted = true;
if (_gui_input_rulers_and_guides(p_event)) {
// print_line("Rulers and guides");
@@ -2722,7 +2722,7 @@ void CanvasItemEditor::_draw_focus() {
}
void CanvasItemEditor::_draw_guides() {
- Color guide_color = EditorSettings::get_singleton()->get("editors/2d/guides_color");
+ Color guide_color = EDITOR_GET("editors/2d/guides_color");
Transform2D xform = viewport_scrollable->get_transform() * transform;
// Guides already there.
@@ -2771,7 +2771,7 @@ void CanvasItemEditor::_draw_guides() {
}
void CanvasItemEditor::_draw_smart_snapping() {
- Color line_color = EditorSettings::get_singleton()->get("editors/2d/smart_snapping_line_color");
+ Color line_color = EDITOR_GET("editors/2d/smart_snapping_line_color");
if (snap_target[0] != SNAP_TARGET_NONE && snap_target[0] != SNAP_TARGET_GRID) {
viewport->draw_set_transform_matrix(viewport->get_transform() * transform * snap_transform);
viewport->draw_line(Point2(0, -1.0e+10F), Point2(0, 1.0e+10F), line_color);
@@ -2889,7 +2889,7 @@ void CanvasItemEditor::_draw_grid() {
// Draw a "primary" line every several lines to make measurements easier.
// The step is configurable in the Configure Snap dialog.
- const Color secondary_grid_color = EditorSettings::get_singleton()->get("editors/2d/grid_color");
+ const Color secondary_grid_color = EDITOR_GET("editors/2d/grid_color");
const Color primary_grid_color =
Color(secondary_grid_color.r, secondary_grid_color.g, secondary_grid_color.b, secondary_grid_color.a * 2.5);
@@ -3565,9 +3565,9 @@ void CanvasItemEditor::_draw_axis() {
if (show_viewport) {
RID ci = viewport->get_canvas_item();
- Color area_axis_color = EditorSettings::get_singleton()->get("editors/2d/viewport_border_color");
+ Color area_axis_color = EDITOR_GET("editors/2d/viewport_border_color");
- Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
+ Size2 screen_size = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height"));
Vector2 screen_endpoints[4] = {
transform.xform(Vector2(0, 0)),
@@ -3871,9 +3871,9 @@ void CanvasItemEditor::_update_editor_settings() {
context_menu_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("ContextualToolbar"), SNAME("EditorStyles")));
- panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/2d_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
- pan_speed = int(EditorSettings::get_singleton()->get("editors/panning/2d_editor_pan_speed"));
- warped_panning = bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning"));
+ panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/2d_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning")));
+ pan_speed = int(EDITOR_GET("editors/panning/2d_editor_pan_speed"));
+ warped_panning = bool(EDITOR_GET("editors/panning/warped_mouse_panning"));
}
void CanvasItemEditor::_notification(int p_what) {
@@ -4019,7 +4019,7 @@ void CanvasItemEditor::_update_scrollbars() {
Size2 vmin = v_scroll->get_minimum_size();
// Get the visible frame.
- Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
+ Size2 screen_rect = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height"));
Rect2 local_rect = Rect2(Point2(), viewport->get_size() - Size2(vmin.width, hmin.height));
// Calculate scrollable area.
@@ -4036,7 +4036,7 @@ void CanvasItemEditor::_update_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"));
+ bool constrain_editor_view = bool(EDITOR_GET("editors/2d/constrain_editor_view"));
if (canvas_item_rect.size.height <= (local_rect.size.y / zoom)) {
real_t centered = -(size.y / 2) / zoom + screen_rect.y / 2;