diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/gpu_particles_2d.cpp | 2 | ||||
-rw-r--r-- | scene/animation/tween.cpp | 13 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 4 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 1 |
4 files changed, 16 insertions, 4 deletions
diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp index cb0349fefd..bed68b4ee0 100644 --- a/scene/2d/gpu_particles_2d.cpp +++ b/scene/2d/gpu_particles_2d.cpp @@ -376,7 +376,7 @@ void GPUParticles2D::_texture_changed() { // Changes to the texture need to trigger an update to make // the editor redraw the sprite with the updated texture. if (texture.is_valid()) { - update(); + queue_redraw(); } } diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 7d9f83b7a2..5b18d4e457 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -75,10 +75,17 @@ Ref<PropertyTweener> Tween::tween_property(Object *p_target, NodePath p_property ERR_FAIL_COND_V_MSG(!valid, nullptr, "Tween invalid. Either finished or created outside scene tree."); ERR_FAIL_COND_V_MSG(started, nullptr, "Can't append to a Tween that has started. Use stop() first."); -#ifdef DEBUG_ENABLED Variant::Type property_type = p_target->get_indexed(p_property.get_as_property_path().get_subnames()).get_type(); - ERR_FAIL_COND_V_MSG(property_type != p_to.get_type(), Ref<PropertyTweener>(), "Type mismatch between property and final value: " + Variant::get_type_name(property_type) + " and " + Variant::get_type_name(p_to.get_type())); -#endif + if (property_type != p_to.get_type()) { + // Cast p_to between floats and ints to avoid minor annoyances. + if (property_type == Variant::FLOAT && p_to.get_type() == Variant::INT) { + p_to = float(p_to); + } else if (property_type == Variant::INT && p_to.get_type() == Variant::FLOAT) { + p_to = int(p_to); + } else { + ERR_FAIL_V_MSG(Ref<PropertyTweener>(), "Type mismatch between property and final value: " + Variant::get_type_name(property_type) + " and " + Variant::get_type_name(p_to.get_type())); + } + } Ref<PropertyTweener> tweener = memnew(PropertyTweener(p_target, p_property, p_to, p_duration)); append(tweener); diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 861a3050cb..3e04ebee6a 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -163,6 +163,10 @@ void TabContainer::_notification(int p_what) { int header_height = _get_top_margin(); + // Draw background for the tabbar. + Ref<StyleBox> tabbar_background = get_theme_stylebox(SNAME("tabbar_background")); + tabbar_background->draw(canvas, Rect2(0, 0, size.width, header_height)); + // Draw the background for the tab's content. panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height)); // Draw the popup menu. diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 410f35e597..73ad1ceff7 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -831,6 +831,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("tab_unselected", "TabContainer", style_tab_unselected); theme->set_stylebox("tab_disabled", "TabContainer", style_tab_disabled); theme->set_stylebox("panel", "TabContainer", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); + theme->set_stylebox("tabbar_background", "TabContainer", make_empty_stylebox(0, 0, 0, 0)); theme->set_icon("increment", "TabContainer", icons["scroll_button_right"]); theme->set_icon("increment_highlight", "TabContainer", icons["scroll_button_right_hl"]); |