summaryrefslogtreecommitdiff
path: root/modules/gdnative
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-13 13:10:42 +0200
committerGitHub <noreply@github.com>2021-07-13 13:10:42 +0200
commitaab6dc301cc2da010ad44da5c08ba3686ef9238a (patch)
tree269b0c913e3e5145f5ed9c449df8a22992adbef2 /modules/gdnative
parentdd274139073da7119dfe8801c8dd29275c5fd830 (diff)
parent56a8d3f30c09fdc03b19ef48a97d344ffe2df974 (diff)
Merge pull request #50086 from Geometror/label-improve-layout-options
Improvements to Label's layout options
Diffstat (limited to 'modules/gdnative')
-rw-r--r--modules/gdnative/include/text/godot_text.h1
-rw-r--r--modules/gdnative/text/text_server_gdnative.cpp5
-rw-r--r--modules/gdnative/text/text_server_gdnative.h2
3 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdnative/include/text/godot_text.h b/modules/gdnative/include/text/godot_text.h
index f3c50e6f87..5c59de7c06 100644
--- a/modules/gdnative/include/text/godot_text.h
+++ b/modules/gdnative/include/text/godot_text.h
@@ -143,6 +143,7 @@ typedef struct {
bool (*shaped_text_shape)(void *, godot_rid *);
bool (*shaped_text_update_breaks)(void *, godot_rid *);
bool (*shaped_text_update_justification_ops)(void *, godot_rid *);
+ void (*shaped_text_overrun_trim_to_width)(void *, godot_rid *, float, uint8_t);
bool (*shaped_text_is_ready)(void *, godot_rid *);
godot_packed_glyph_array (*shaped_text_get_glyphs)(void *, godot_rid *);
godot_vector2i (*shaped_text_get_range)(void *, godot_rid *);
diff --git a/modules/gdnative/text/text_server_gdnative.cpp b/modules/gdnative/text/text_server_gdnative.cpp
index bc4b1ac134..392121c3a9 100644
--- a/modules/gdnative/text/text_server_gdnative.cpp
+++ b/modules/gdnative/text/text_server_gdnative.cpp
@@ -498,6 +498,11 @@ bool TextServerGDNative::shaped_text_update_justification_ops(RID p_shaped) {
return interface->shaped_text_update_justification_ops(data, (godot_rid *)&p_shaped);
}
+void TextServerGDNative::shaped_text_overrun_trim_to_width(RID p_shaped_line, float p_width, uint8_t p_clip_flags) {
+ ERR_FAIL_COND(interface == nullptr);
+ interface->shaped_text_overrun_trim_to_width(data, (godot_rid *)&p_shaped_line, p_width, p_clip_flags);
+};
+
bool TextServerGDNative::shaped_text_is_ready(RID p_shaped) const {
ERR_FAIL_COND_V(interface == nullptr, false);
return interface->shaped_text_is_ready(data, (godot_rid *)&p_shaped);
diff --git a/modules/gdnative/text/text_server_gdnative.h b/modules/gdnative/text/text_server_gdnative.h
index 7e42b16fe1..d613a7ec00 100644
--- a/modules/gdnative/text/text_server_gdnative.h
+++ b/modules/gdnative/text/text_server_gdnative.h
@@ -167,6 +167,8 @@ public:
virtual bool shaped_text_update_breaks(RID p_shaped) override;
virtual bool shaped_text_update_justification_ops(RID p_shaped) override;
+ virtual void shaped_text_overrun_trim_to_width(RID p_shaped, float p_width, uint8_t p_clip_flags) override;
+
virtual bool shaped_text_is_ready(RID p_shaped) const override;
virtual Vector<Glyph> shaped_text_get_glyphs(RID p_shaped) const override;