Get rid of easily removable uses of const_cast

This commit is contained in:
rune-scape
2024-07-29 21:23:12 -07:00
committed by rune-scape
parent 893bbdfde8
commit d58b2e879f
69 changed files with 342 additions and 306 deletions

View File

@ -488,7 +488,7 @@ Size2 Button::get_minimum_size_for_text_and_icon(const String &p_text, Ref<Textu
paragraph = text_buf;
} else {
paragraph.instantiate();
const_cast<Button *>(this)->_shape(paragraph, p_text);
_shape(paragraph, p_text);
}
Size2 minsize = paragraph->get_size();
@ -527,7 +527,7 @@ Size2 Button::get_minimum_size_for_text_and_icon(const String &p_text, Ref<Textu
return (theme_cache.align_to_largest_stylebox ? _get_largest_stylebox_size() : _get_current_stylebox()->get_minimum_size()) + minsize;
}
void Button::_shape(Ref<TextParagraph> p_paragraph, String p_text) {
void Button::_shape(Ref<TextParagraph> p_paragraph, String p_text) const {
if (p_paragraph.is_null()) {
p_paragraph = text_buf;
}