From c2297215e35f29fdd6316e89256dfb6c1a8ee40a Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 10 Mar 2022 10:59:01 +0800 Subject: [PATCH] Fix TextureRegion editor grid color for light themes (cherry picked from commit af16e099ead73061daf15624838261976ba49524) --- editor/plugins/texture_region_editor_plugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index b251c81608f..8340d303c21 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -87,8 +87,10 @@ void TextureRegionEditor::_region_draw() { edit_draw->draw_texture(base_tex, Point2()); VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D()); + const Color color = get_color("mono_color", "Editor"); + if (snap_mode == SNAP_GRID) { - Color grid_color = Color(1.0, 1.0, 1.0, 0.15); + const Color grid_color = Color(color.r, color.g, color.b, color.a * 0.15); Size2 s = edit_draw->get_size(); int last_cell = 0; @@ -175,7 +177,6 @@ void TextureRegionEditor::_region_draw() { mtx.basis_xform(raw_endpoints[2]), mtx.basis_xform(raw_endpoints[3]) }; - Color color = get_color("mono_color", "Editor"); for (int i = 0; i < 4; i++) { int prev = (i + 3) % 4; int next = (i + 1) % 4;