diff options
author | MaidOpi <maidopi@qq.com> | 2024-11-07 03:28:08 +0800 |
---|---|---|
committer | MaidOpi <maidopi@qq.com> | 2024-11-07 03:28:08 +0800 |
commit | 07b7af0c8119ca80b5396f1be8ce2c81024af551 (patch) | |
tree | 79c1e08a4fbff7b5074a54dd0c4851d79bfb4a93 /scene/resources | |
parent | 87318a2fb7fffeb72adca934e31915be077c3d1f (diff) | |
download | redot-engine-07b7af0c8119ca80b5396f1be8ce2c81024af551.tar.gz |
replace computed height with cached item minimum size
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/text_paragraph.cpp | 4 | ||||
-rw-r--r-- | scene/resources/text_paragraph.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/scene/resources/text_paragraph.cpp b/scene/resources/text_paragraph.cpp index 29a8541cb0..f8fd51e26a 100644 --- a/scene/resources/text_paragraph.cpp +++ b/scene/resources/text_paragraph.cpp @@ -1012,6 +1012,10 @@ int TextParagraph::hit_test(const Point2 &p_coords) const { return TS->shaped_text_get_range(rid).y; } +bool TextParagraph::is_dirty() { + return lines_dirty; +} + void TextParagraph::draw_dropcap(RID p_canvas, const Vector2 &p_pos, const Color &p_color) const { _THREAD_SAFE_METHOD_ diff --git a/scene/resources/text_paragraph.h b/scene/resources/text_paragraph.h index 8b7f21fa9a..b083c8fe68 100644 --- a/scene/resources/text_paragraph.h +++ b/scene/resources/text_paragraph.h @@ -152,6 +152,8 @@ public: int hit_test(const Point2 &p_coords) const; + bool is_dirty(); + Mutex &get_mutex() const { return _thread_safe_; } TextParagraph(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language = "", float p_width = -1.f, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL); |