Fix issues found by a static analyzer

This commit is contained in:
bitsawer
2023-05-30 12:47:50 +03:00
parent 8f25cc2d13
commit 78361370ec
2 changed files with 4 additions and 12 deletions

View File

@@ -525,11 +525,7 @@ Size2 TextParagraph::get_non_wrapped_size() const {
_THREAD_SAFE_METHOD_
const_cast<TextParagraph *>(this)->_shape_lines();
if (TS->shaped_text_get_orientation(rid) == TextServer::ORIENTATION_HORIZONTAL) {
return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y);
} else {
return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y);
}
return TS->shaped_text_get_size(rid);
}
Size2 TextParagraph::get_size() const {
@@ -675,11 +671,7 @@ Size2 TextParagraph::get_line_size(int p_line) const {
const_cast<TextParagraph *>(this)->_shape_lines();
ERR_FAIL_COND_V(p_line < 0 || p_line >= (int)lines_rid.size(), Size2());
if (TS->shaped_text_get_orientation(lines_rid[p_line]) == TextServer::ORIENTATION_HORIZONTAL) {
return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x, TS->shaped_text_get_size(lines_rid[p_line]).y);
} else {
return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x, TS->shaped_text_get_size(lines_rid[p_line]).y);
}
return TS->shaped_text_get_size(lines_rid[p_line]);
}
Vector2i TextParagraph::get_line_range(int p_line) const {