diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/camera_2d.cpp | 8 | ||||
-rw-r--r-- | scene/2d/path_2d.cpp | 6 | ||||
-rw-r--r-- | scene/2d/path_2d.h | 2 | ||||
-rw-r--r-- | scene/3d/path_3d.cpp | 6 | ||||
-rw-r--r-- | scene/3d/path_3d.h | 2 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 11 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 45 | ||||
-rw-r--r-- | scene/gui/tab_container.h | 1 |
8 files changed, 49 insertions, 32 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 8f69676da4..68e99445d8 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -343,7 +343,9 @@ void Camera2D::_notification(int p_what) { void Camera2D::set_offset(const Vector2 &p_offset) { offset = p_offset; + Point2 old_smoothed_camera_pos = smoothed_camera_pos; _update_scroll(); + smoothed_camera_pos = old_smoothed_camera_pos; } Vector2 Camera2D::get_offset() const { @@ -361,7 +363,9 @@ Camera2D::AnchorMode Camera2D::get_anchor_mode() const { void Camera2D::set_rotating(bool p_rotating) { rotating = p_rotating; + Point2 old_smoothed_camera_pos = smoothed_camera_pos; _update_scroll(); + smoothed_camera_pos = old_smoothed_camera_pos; } bool Camera2D::is_rotating() const { @@ -522,7 +526,9 @@ bool Camera2D::is_v_drag_enabled() const { void Camera2D::set_v_offset(float p_offset) { v_ofs = p_offset; v_offset_changed = true; + Point2 old_smoothed_camera_pos = smoothed_camera_pos; _update_scroll(); + smoothed_camera_pos = old_smoothed_camera_pos; } float Camera2D::get_v_offset() const { @@ -532,7 +538,9 @@ float Camera2D::get_v_offset() const { void Camera2D::set_h_offset(float p_offset) { h_ofs = p_offset; h_offset_changed = true; + Point2 old_smoothed_camera_pos = smoothed_camera_pos; _update_scroll(); + smoothed_camera_pos = old_smoothed_camera_pos; } float Camera2D::get_h_offset() const { diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 00e9af3bb7..f2f549e851 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -149,11 +149,7 @@ void Path2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_curve", "curve"), &Path2D::set_curve); ClassDB::bind_method(D_METHOD("get_curve"), &Path2D::get_curve); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve2D"), "set_curve", "get_curve"); -} - -Path2D::Path2D() { - set_curve(Ref<Curve2D>(memnew(Curve2D))); //create one by default + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve2D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT), "set_curve", "get_curve"); } ///////////////////////////////////////////////////////////////////////////////// diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h index 288ef698e7..38fcca0323 100644 --- a/scene/2d/path_2d.h +++ b/scene/2d/path_2d.h @@ -55,7 +55,7 @@ public: void set_curve(const Ref<Curve2D> &p_curve); Ref<Curve2D> get_curve() const; - Path2D(); + Path2D() {} }; class PathFollow2D : public Node2D { diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index dcfdf8efcf..40d988ff9f 100644 --- a/scene/3d/path_3d.cpp +++ b/scene/3d/path_3d.cpp @@ -77,15 +77,11 @@ void Path3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_curve", "curve"), &Path3D::set_curve); ClassDB::bind_method(D_METHOD("get_curve"), &Path3D::get_curve); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), "set_curve", "get_curve"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT), "set_curve", "get_curve"); ADD_SIGNAL(MethodInfo("curve_changed")); } -Path3D::Path3D() { - set_curve(Ref<Curve3D>(memnew(Curve3D))); //create one by default -} - ////////////// void PathFollow3D::_update_transform() { diff --git a/scene/3d/path_3d.h b/scene/3d/path_3d.h index 5a33016bc6..7f227a8a6f 100644 --- a/scene/3d/path_3d.h +++ b/scene/3d/path_3d.h @@ -49,7 +49,7 @@ public: void set_curve(const Ref<Curve3D> &p_curve); Ref<Curve3D> get_curve() const; - Path3D(); + Path3D() {} }; class PathFollow3D : public Node3D { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 662eae394f..92508f7fd2 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2412,6 +2412,17 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) { } } + Vector<ItemFX *> fx_items; + for (List<Item *>::Element *E = main->subitems.front(); E; E = E->next()) { + Item *subitem = static_cast<Item *>(E->get()); + _fetch_item_fx_stack(subitem, fx_items); + + if (fx_items.size()) { + set_process_internal(true); + break; + } + } + return OK; } diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 8c4d9a5ece..0d48fde642 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -435,7 +435,30 @@ void TabContainer::_notification(int p_what) { void TabContainer::_on_theme_changed() { if (get_tab_count() > 0) { - set_current_tab(get_current_tab()); + _repaint(); + update(); + } +} + +void TabContainer::_repaint() { + Ref<StyleBox> sb = get_theme_stylebox("panel"); + Vector<Control *> tabs = _get_tabs(); + for (int i = 0; i < tabs.size(); i++) { + Control *c = tabs[i]; + if (i == current) { + c->show(); + c->set_anchors_and_margins_preset(Control::PRESET_WIDE); + if (tabs_visible) { + c->set_margin(MARGIN_TOP, _get_top_margin()); + } + c->set_margin(Margin(MARGIN_TOP), c->get_margin(Margin(MARGIN_TOP)) + sb->get_margin(Margin(MARGIN_TOP))); + c->set_margin(Margin(MARGIN_LEFT), c->get_margin(Margin(MARGIN_LEFT)) + sb->get_margin(Margin(MARGIN_LEFT))); + c->set_margin(Margin(MARGIN_RIGHT), c->get_margin(Margin(MARGIN_RIGHT)) - sb->get_margin(Margin(MARGIN_RIGHT))); + c->set_margin(Margin(MARGIN_BOTTOM), c->get_margin(Margin(MARGIN_BOTTOM)) - sb->get_margin(Margin(MARGIN_BOTTOM))); + + } else { + c->hide(); + } } } @@ -551,25 +574,7 @@ void TabContainer::set_current_tab(int p_current) { int pending_previous = current; current = p_current; - Ref<StyleBox> sb = get_theme_stylebox("panel"); - Vector<Control *> tabs = _get_tabs(); - for (int i = 0; i < tabs.size(); i++) { - Control *c = tabs[i]; - if (i == current) { - c->show(); - c->set_anchors_and_margins_preset(Control::PRESET_WIDE); - if (tabs_visible) { - c->set_margin(MARGIN_TOP, _get_top_margin()); - } - c->set_margin(Margin(MARGIN_TOP), c->get_margin(Margin(MARGIN_TOP)) + sb->get_margin(Margin(MARGIN_TOP))); - c->set_margin(Margin(MARGIN_LEFT), c->get_margin(Margin(MARGIN_LEFT)) + sb->get_margin(Margin(MARGIN_LEFT))); - c->set_margin(Margin(MARGIN_RIGHT), c->get_margin(Margin(MARGIN_RIGHT)) - sb->get_margin(Margin(MARGIN_RIGHT))); - c->set_margin(Margin(MARGIN_BOTTOM), c->get_margin(Margin(MARGIN_BOTTOM)) - sb->get_margin(Margin(MARGIN_BOTTOM))); - - } else { - c->hide(); - } - } + _repaint(); _change_notify("current_tab"); diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index e8cde74c83..55a5d35b30 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -65,6 +65,7 @@ private: Vector<Control *> _get_tabs() const; int _get_tab_width(int p_index) const; void _on_theme_changed(); + void _repaint(); void _on_mouse_exited(); void _update_current_tab(); |