summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-10 08:00:25 +0100
committerGitHub <noreply@github.com>2022-03-10 08:00:25 +0100
commit1571c982cac806ecd96f27c35f6ff0942f94b5a5 (patch)
treea8ef949614bbe5bf75892a95dad8868d99a4b230 /editor/plugins
parent450ebaab9f333ca463e6e57a29fdc2e47c227c36 (diff)
parentaf16e099ead73061daf15624838261976ba49524 (diff)
Merge pull request #58963 from timothyqiu/texture-region-grid-color
Fix TextureRegion editor grid color for light themes
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index ee31131d86..adb8590246 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -85,8 +85,10 @@ void TextureRegionEditor::_region_draw() {
edit_draw->draw_texture(base_tex, Point2());
RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D());
+ const Color color = get_theme_color(SNAME("mono_color"), SNAME("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;
@@ -172,7 +174,6 @@ void TextureRegionEditor::_region_draw() {
mtx.basis_xform(raw_endpoints[2]),
mtx.basis_xform(raw_endpoints[3])
};
- Color color = get_theme_color(SNAME("mono_color"), SNAME("Editor"));
for (int i = 0; i < 4; i++) {
int prev = (i + 3) % 4;
int next = (i + 1) % 4;