Repository: godotengine/godot
File: scene/gui/rich_text_label.cpp (C++)

Code before:

						int char_offset = l.char_offset + l.char_count;
						int w = _find_margin(line.from, p_base_font, p_base_font_size) + 1;
						prev_h = _shape_line(frame, i, p_base_font, p_base_font_size, w, prev_h, &char_offset);
						int cell_ch = (char_offset - (l.char_offset + l.char_count));
						l.char_count += cell_ch;
						t_char_count += cell_ch;
						remaining_characters -= cell_ch;

						C.min_width = MAX(C.min_width, std::ceil(frame_padding_space + line.indent) + std::ceil(line.text_buf->get_size().x));
						C.max_width = MAX(C.max_width, _get_line_max_width(frame, i));
					}
					idx++;
				}

				// Compute width for each column.
				const int available_width = p_width - l.offset.x - theme_cache.table_h_separation * col_count;
				_update_table_column_width(table, available_width);

				// Resize for elements in the table.
				idx = 0;
				for (Item *E : table->subitems) {
					ERR_CONTINUE(E->type != ITEM_FRAME); // Children should all be frames.
					ItemFrame *frame = static_cast<ItemFrame *>(E);

					const int frame_padding_space = std::ceil(frame->padding.position.x + frame->padding.size.x);

					int column = idx % col_count;
					float prev_h = 0;
					for (int i = 0; i < (int)frame->lines.size(); i++) {
						MutexLock sub_lock(frame->lines[i].text_buf->get_mutex());
						int w = table->columns[column].width - frame_padding_space;
						w = MAX(w, _find_margin(frame->lines[i].from, p_base_font, p_base_font_size) + 1);
						prev_h = _resize_line(frame, i, p_base_font, p_base_font_size, w, prev_h);
					}
					idx++;
				}

				// Compute size and offset for each element in the table.
				_update_table_size(table);

				int row_idx = (table->align_to_row < 0) ? table->rows_baseline.size() - 1 : table->align_to_row;
				if (table->rows_baseline.size() != 0 && row_idx < (int)table->rows_baseline.size()) {
					l.text_buf->add_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align, t_char_count, Math::round(table->rows_baseline[row_idx]));
				} else {
					l.text_buf->add_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align, t_char_count);
				}
				txt += String::chr(0xfffc).repeat(t_char_count);
			} break;
			default:
				break;

Review comment (suggestion):
```suggestion
					const int frame_padding_space = Math::ceil(frame->padding.position.x + frame->padding.size.x);
```

Code after:
						MutexLock sub_lock(line.text_buf->get_mutex());

						int char_offset = l.char_offset + l.char_count;
						int w = _find_margin(line.from, p_base_font, p_base_font_size) + 1;
						prev_h = _shape_line(frame, i, p_base_font, p_base_font_size, w, prev_h, &char_offset);
						int cell_ch = (char_offset - (l.char_offset + l.char_count));
						l.char_count += cell_ch;
						t_char_count += cell_ch;
						remaining_characters -= cell_ch;

						C.min_width = MAX(C.min_width, Math::ceil(frame_padding_space + line.indent) + Math::ceil(line.text_buf->get_size().x));
						C.max_width = MAX(C.max_width, _get_line_max_width(frame, i));
					}
					idx++;
				}

				// Compute width for each column.
				const int available_width = p_width - l.offset.x - theme_cache.table_h_separation * col_count;
				_update_table_column_width(table, available_width);

				// Resize for elements in the table.
				idx = 0;
				for (Item *E : table->subitems) {
					ERR_CONTINUE(E->type != ITEM_FRAME); // Children should all be frames.
					ItemFrame *frame = static_cast<ItemFrame *>(E);

					const int frame_padding_space = Math::ceil(frame->padding.position.x + frame->padding.size.x);

					int column = idx % col_count;
					float prev_h = 0;
					for (int i = 0; i < (int)frame->lines.size(); i++) {
						MutexLock sub_lock(frame->lines[i].text_buf->get_mutex());
						int w = table->columns[column].width - frame_padding_space;
						w = MAX(w, _find_margin(frame->lines[i].from, p_base_font, p_base_font_size) + 1);
						prev_h = _resize_line(frame, i, p_base_font, p_base_font_size, w, prev_h);
					}
					idx++;
				}

				// Compute size and offset for each element in the table.
				_update_table_size(table);

				int row_idx = (table->align_to_row < 0) ? table->rows_baseline.size() - 1 : table->align_to_row;
				if (table->rows_baseline.size() != 0 && row_idx < (int)table->rows_baseline.size()) {
					l.text_buf->add_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align, t_char_count, Math::round(table->rows_baseline[row_idx]));
				} else {
					l.text_buf->add_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align, t_char_count);
				}
				txt += String::chr(0xfffc).repeat(t_char_count);
			} break;
			default: