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

@@ -232,7 +232,7 @@ Size2 PopupMenu::_get_contents_minimum_size() const {
for (int i = 0; i < items.size(); i++) {
Size2 item_size;
const_cast<PopupMenu *>(this)->_shape_item(i);
_shape_item(i);
Size2 icon_size = _get_item_icon_size(i);
item_size.height = _get_item_height(i);
@@ -946,7 +946,7 @@ void PopupMenu::_close_pressed() {
}
}
void PopupMenu::_shape_item(int p_idx) {
void PopupMenu::_shape_item(int p_idx) const {
if (items.write[p_idx].dirty) {
items.write[p_idx].text_buf->clear();