summaryrefslogtreecommitdiff
path: root/editor/plugins/canvas_item_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-19 14:17:55 +0200
committerGitHub <noreply@github.com>2018-08-19 14:17:55 +0200
commit5d09877da8003740928502aead0b46505495721f (patch)
tree831fdf88f4ce6154681cbc023bc7e7177c196bb0 /editor/plugins/canvas_item_editor_plugin.cpp
parent88cb039f3913a5cf5d6426c1f59019b2b5f0c094 (diff)
parent66c25d48290b0b53f1febbfa4af3d4982f6f3204 (diff)
Merge pull request #21154 from Chaosus/grid_2d_color
Added setting to change color of 2d editor grid
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 145a2ef9bb..72248b62a3 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2276,14 +2276,14 @@ void CanvasItemEditor::_draw_grid() {
real_grid_offset = grid_offset;
}
- const Color grid_minor_color = get_color("grid_minor_color", "Editor");
+ const Color grid_color = EditorSettings::get_singleton()->get("editors/2d/grid_color");
if (grid_step.x != 0) {
for (int i = 0; i < s.width; i++) {
int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(i, 0)).x - real_grid_offset.x) / (grid_step.x * Math::pow(2.0, grid_step_multiplier))));
if (i == 0)
last_cell = cell;
if (last_cell != cell)
- viewport->draw_line(Point2(i, 0), Point2(i, s.height), grid_minor_color);
+ viewport->draw_line(Point2(i, 0), Point2(i, s.height), grid_color);
last_cell = cell;
}
}
@@ -2294,7 +2294,7 @@ void CanvasItemEditor::_draw_grid() {
if (i == 0)
last_cell = cell;
if (last_cell != cell)
- viewport->draw_line(Point2(0, i), Point2(s.width, i), grid_minor_color);
+ viewport->draw_line(Point2(0, i), Point2(s.width, i), grid_color);
last_cell = cell;
}
}