Skip to content

Commit

Permalink
Fix multiple usability issues in the texture region editor
Browse files Browse the repository at this point in the history
- Correctly display atlas textures when used by other objects.
- Make region handles easier to hit in ninepatchable objects.
- Correctly initialize and restore various visual properties.
- Improve code quality.
  • Loading branch information
YuriSizov committed Aug 27, 2023
1 parent 6758a7f commit 4b7d0c8
Show file tree
Hide file tree
Showing 4 changed files with 414 additions and 405 deletions.
5 changes: 5 additions & 0 deletions editor/editor_themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
style_theme_preview_bg_tab->set_expand_margin(SIDE_BOTTOM, 2 * EDSCALE);
theme->set_stylebox("ThemeEditorPreviewBG", "EditorStyles", style_theme_preview_bg_tab);

Ref<StyleBoxFlat> style_texture_region_bg = style_tree_bg->duplicate();
style_texture_region_bg->set_content_margin_all(0);
theme->set_stylebox("TextureRegionPreviewBG", "EditorStyles", style_texture_region_bg);
theme->set_stylebox("TextureRegionPreviewFG", "EditorStyles", make_empty_stylebox(0, 0, 0, 0));

// Separators
theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width)));
theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width), 0, 0, true));
Expand Down
Loading

0 comments on commit 4b7d0c8

Please sign in to comment.