summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/editor_help.h4
-rw-r--r--editor/editor_themes.cpp2
-rw-r--r--scene/gui/texture_rect.cpp9
3 files changed, 11 insertions, 4 deletions
diff --git a/editor/editor_help.h b/editor/editor_help.h
index d9c7194003..2e053e674f 100644
--- a/editor/editor_help.h
+++ b/editor/editor_help.h
@@ -192,9 +192,9 @@ public:
~EditorHelp();
};
-class EditorHelpBit : public PanelContainer {
+class EditorHelpBit : public MarginContainer {
- GDCLASS(EditorHelpBit, PanelContainer);
+ GDCLASS(EditorHelpBit, MarginContainer);
RichTextLabel *rich_text;
void _go_to_help(String p_what);
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index a9af29ddf2..37bca661dd 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -977,8 +977,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
theme->set_stylebox("normal", "RichTextLabel", style_tree_bg);
- theme->set_stylebox("panel", "EditorHelpBit", make_flat_stylebox(dark_color_1, 6, 4, 6, 4));
-
theme->set_color("headline_color", "EditorHelp", mono_color);
// Panel
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp
index baa138847f..92f3c5b5d9 100644
--- a/scene/gui/texture_rect.cpp
+++ b/scene/gui/texture_rect.cpp
@@ -95,6 +95,15 @@ void TextureRect::_notification(int p_what) {
} break;
}
+ Ref<AtlasTexture> p_atlas = texture;
+
+ if (p_atlas.is_valid() && region.has_no_area()) {
+ Size2 scale_size(size.width / texture->get_width(), size.height / texture->get_height());
+
+ offset.width += hflip ? p_atlas->get_margin().get_position().width * scale_size.width * 2 : 0;
+ offset.height += vflip ? p_atlas->get_margin().get_position().height * scale_size.height * 2 : 0;
+ }
+
size.width *= hflip ? -1.0f : 1.0f;
size.height *= vflip ? -1.0f : 1.0f;