diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/soft_body_3d.cpp | 14 | ||||
-rw-r--r-- | scene/3d/soft_body_3d.h | 2 | ||||
-rw-r--r-- | scene/gui/code_edit.cpp | 2 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 18 | ||||
-rw-r--r-- | scene/resources/sprite_frames.cpp | 2 | ||||
-rw-r--r-- | scene/resources/tile_set.cpp | 5 | ||||
-rw-r--r-- | scene/resources/tile_set.h | 1 |
7 files changed, 31 insertions, 13 deletions
diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp index e7e3084037..9fa33e9d5c 100644 --- a/scene/3d/soft_body_3d.cpp +++ b/scene/3d/soft_body_3d.cpp @@ -217,8 +217,7 @@ bool SoftBody3D::_set_property_pinned_points_attachment(int p_item, const String if ("spatial_attachment_path" == p_what) { PinnedPoint *w = pinned_points.ptrw(); - pin_point(w[p_item].point_index, true, p_value); - _make_cache_dirty(); + callable_mp(this, &SoftBody3D::_pin_point_deferred).call_deferred(Variant(w[p_item].point_index), true, p_value); } else if ("offset" == p_what) { PinnedPoint *w = pinned_points.ptrw(); w[p_item].offset = p_value; @@ -670,6 +669,11 @@ void SoftBody3D::pin_point(int p_point_index, bool pin, const NodePath &p_spatia } } +void SoftBody3D::_pin_point_deferred(int p_point_index, bool pin, const NodePath p_spatial_attachment_path) { + pin_point(p_point_index, pin, p_spatial_attachment_path); + _make_cache_dirty(); +} + bool SoftBody3D::is_point_pinned(int p_point_index) const { return -1 != _has_pinned_point(p_point_index); } @@ -741,7 +745,11 @@ void SoftBody3D::_add_pinned_point(int p_point_index, const NodePath &p_spatial_ pinned_point->spatial_attachment_path = p_spatial_attachment_path; if (!p_spatial_attachment_path.is_empty() && has_node(p_spatial_attachment_path)) { - pinned_point->spatial_attachment = Object::cast_to<Node3D>(get_node(p_spatial_attachment_path)); + Node3D *attachment_node = Object::cast_to<Node3D>(get_node(p_spatial_attachment_path)); + + ERR_FAIL_NULL_MSG(attachment_node, "Attachment node path is invalid."); + + pinned_point->spatial_attachment = attachment_node; pinned_point->offset = (pinned_point->spatial_attachment->get_global_transform().affine_inverse() * get_global_transform()).xform(PhysicsServer3D::get_singleton()->soft_body_get_point_global_position(physics_rid, pinned_point->point_index)); } } diff --git a/scene/3d/soft_body_3d.h b/scene/3d/soft_body_3d.h index d81011006b..0b75ae2cda 100644 --- a/scene/3d/soft_body_3d.h +++ b/scene/3d/soft_body_3d.h @@ -179,6 +179,8 @@ public: void pin_point(int p_point_index, bool pin, const NodePath &p_spatial_attachment_path = NodePath()); bool is_point_pinned(int p_point_index) const; + void _pin_point_deferred(int p_point_index, bool pin, const NodePath p_spatial_attachment_path); + void set_ray_pickable(bool p_ray_pickable); bool is_ray_pickable() const; diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index e2f7ec860c..ee39327d4d 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -896,6 +896,7 @@ void CodeEdit::indent_lines() { set_caret_column(get_caret_column(c) + selection_offset, false, c); } end_complex_operation(); + queue_redraw(); } void CodeEdit::unindent_lines() { @@ -973,6 +974,7 @@ void CodeEdit::unindent_lines() { set_caret_column(initial_cursor_column - removed_characters, false, c); } end_complex_operation(); + queue_redraw(); } int CodeEdit::_calculate_spaces_till_next_left_indent(int p_column) const { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 973b02b3a3..44478d45cc 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1165,7 +1165,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o } else if (ul_started) { ul_started = false; float y_off = TS->shaped_text_get_underline_position(rid); - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_line(ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), ul_color, underline_width); } if (_find_hint(it, nullptr) && underline_hint) { @@ -1178,7 +1178,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o } else if (dot_ul_started) { dot_ul_started = false; float y_off = TS->shaped_text_get_underline_position(rid); - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, MAX(2.0, underline_width * 2)); } if (_find_strikethrough(it)) { @@ -1191,7 +1191,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o } else if (st_started) { st_started = false; float y_off = -TS->shaped_text_get_ascent(rid) + TS->shaped_text_get_size(rid).y / 2; - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_line(st_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), st_color, underline_width); } @@ -1334,19 +1334,19 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o if (ul_started) { ul_started = false; float y_off = TS->shaped_text_get_underline_position(rid); - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_line(ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), ul_color, underline_width); } if (dot_ul_started) { dot_ul_started = false; float y_off = TS->shaped_text_get_underline_position(rid); - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, MAX(2.0, underline_width * 2)); } if (st_started) { st_started = false; float y_off = -TS->shaped_text_get_ascent(rid) + TS->shaped_text_get_size(rid).y / 2; - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_line(st_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), st_color, underline_width); } } @@ -1356,19 +1356,19 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o if (ul_started) { ul_started = false; float y_off = TS->shaped_text_get_underline_position(rid); - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_line(ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), ul_color, underline_width); } if (dot_ul_started) { dot_ul_started = false; float y_off = TS->shaped_text_get_underline_position(rid); - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, MAX(2.0, underline_width * 2)); } if (st_started) { st_started = false; float y_off = -TS->shaped_text_get_ascent(rid) + TS->shaped_text_get_size(rid).y / 2; - float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale; + float underline_width = MAX(1.0, TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale); draw_line(st_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), st_color, underline_width); } // Draw foreground color box diff --git a/scene/resources/sprite_frames.cpp b/scene/resources/sprite_frames.cpp index 818be38681..17aaf579dd 100644 --- a/scene/resources/sprite_frames.cpp +++ b/scene/resources/sprite_frames.cpp @@ -201,6 +201,7 @@ void SpriteFrames::_set_animations(const Array &p_animations) { anim.loop = d["loop"]; Array frames = d["frames"]; for (int j = 0; j < frames.size(); j++) { +#ifndef DISABLE_DEPRECATED // For compatibility. Ref<Resource> res = frames[j]; if (res.is_valid()) { @@ -208,6 +209,7 @@ void SpriteFrames::_set_animations(const Array &p_animations) { anim.frames.push_back(frame); continue; } +#endif Dictionary f = frames[j]; diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index d4b2be355e..efe04ce4e1 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -2527,6 +2527,11 @@ void TileSet::reset_state() { while (!source_ids.is_empty()) { remove_source(source_ids[0]); } + + tile_shape = TILE_SHAPE_SQUARE; + tile_layout = TILE_LAYOUT_STACKED; + tile_offset_axis = TILE_OFFSET_AXIS_HORIZONTAL; + tile_size = Size2i(16, 16); } const Vector2i TileSetSource::INVALID_ATLAS_COORDS = Vector2i(-1, -1); diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index ad25629a1c..d62bac8570 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -308,7 +308,6 @@ private: TileLayout tile_layout = TILE_LAYOUT_STACKED; TileOffsetAxis tile_offset_axis = TILE_OFFSET_AXIS_HORIZONTAL; Size2i tile_size = Size2i(16, 16); //Size2(64, 64); - Vector2 tile_skew = Vector2(0, 0); // Rendering. bool uv_clipping = false; |