diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-16 16:52:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 16:52:48 +0200 |
commit | 2aec92412f39367d2e720544530963707522e510 (patch) | |
tree | da7986667a303752dae3ba1471910442a5ce3984 /scene/resources/text_paragraph.cpp | |
parent | 639d72735c2e9bfff013029e3c797a2102797e82 (diff) | |
parent | b5c96df2771113cd9c5cb24b07b199a08a8ad917 (diff) |
Merge pull request #62066 from bruvzg/cleanup_ts_enums
Diffstat (limited to 'scene/resources/text_paragraph.cpp')
-rw-r--r-- | scene/resources/text_paragraph.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/scene/resources/text_paragraph.cpp b/scene/resources/text_paragraph.cpp index 477b41efaa..874992ea3d 100644 --- a/scene/resources/text_paragraph.cpp +++ b/scene/resources/text_paragraph.cpp @@ -129,12 +129,6 @@ void TextParagraph::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_dropcap_outline", "canvas", "pos", "outline_size", "color"), &TextParagraph::draw_dropcap_outline, DEFVAL(1), DEFVAL(Color(1, 1, 1))); ClassDB::bind_method(D_METHOD("hit_test", "coords"), &TextParagraph::hit_test); - - BIND_ENUM_CONSTANT(OVERRUN_NO_TRIMMING); - BIND_ENUM_CONSTANT(OVERRUN_TRIM_CHAR); - BIND_ENUM_CONSTANT(OVERRUN_TRIM_WORD); - BIND_ENUM_CONSTANT(OVERRUN_TRIM_ELLIPSIS); - BIND_ENUM_CONSTANT(OVERRUN_TRIM_WORD_ELLIPSIS); } void TextParagraph::_shape_lines() { @@ -190,26 +184,26 @@ void TextParagraph::_shape_lines() { lines_rid.push_back(line); } - uint16_t overrun_flags = TextServer::OVERRUN_NO_TRIMMING; - if (overrun_behavior != OVERRUN_NO_TRIMMING) { + uint16_t overrun_flags = TextServer::OVERRUN_NO_TRIM; + if (overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) { switch (overrun_behavior) { - case OVERRUN_TRIM_WORD_ELLIPSIS: + case TextServer::OVERRUN_TRIM_WORD_ELLIPSIS: overrun_flags |= TextServer::OVERRUN_TRIM; overrun_flags |= TextServer::OVERRUN_TRIM_WORD_ONLY; overrun_flags |= TextServer::OVERRUN_ADD_ELLIPSIS; break; - case OVERRUN_TRIM_ELLIPSIS: + case TextServer::OVERRUN_TRIM_ELLIPSIS: overrun_flags |= TextServer::OVERRUN_TRIM; overrun_flags |= TextServer::OVERRUN_ADD_ELLIPSIS; break; - case OVERRUN_TRIM_WORD: + case TextServer::OVERRUN_TRIM_WORD: overrun_flags |= TextServer::OVERRUN_TRIM; overrun_flags |= TextServer::OVERRUN_TRIM_WORD_ONLY; break; - case OVERRUN_TRIM_CHAR: + case TextServer::OVERRUN_TRIM_CHAR: overrun_flags |= TextServer::OVERRUN_TRIM; break; - case OVERRUN_NO_TRIMMING: + case TextServer::OVERRUN_NO_TRIMMING: break; } } @@ -451,7 +445,7 @@ uint16_t TextParagraph::get_flags() const { return flags; } -void TextParagraph::set_text_overrun_behavior(TextParagraph::OverrunBehavior p_behavior) { +void TextParagraph::set_text_overrun_behavior(TextServer::OverrunBehavior p_behavior) { _THREAD_SAFE_METHOD_ if (overrun_behavior != p_behavior) { @@ -460,7 +454,7 @@ void TextParagraph::set_text_overrun_behavior(TextParagraph::OverrunBehavior p_b } } -TextParagraph::OverrunBehavior TextParagraph::get_text_overrun_behavior() const { +TextServer::OverrunBehavior TextParagraph::get_text_overrun_behavior() const { return overrun_behavior; } |