mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-26 00:45:35 +00:00
Codechange: use size_t for glyph/run counts, remove unneeded glyph count instance variable
This commit is contained in:
+3
-3
@@ -270,7 +270,7 @@ ParagraphLayouter::Position Layouter::GetCharPosition(std::string_view::const_it
|
||||
|
||||
/* Scan all runs until we've found our code point index. */
|
||||
size_t best_index = SIZE_MAX;
|
||||
for (int run_index = 0; run_index < line->CountRuns(); run_index++) {
|
||||
for (size_t run_index = 0; run_index < line->CountRuns(); run_index++) {
|
||||
const ParagraphLayouter::VisualRun &run = line->GetVisualRun(run_index);
|
||||
const auto &positions = run.GetPositions();
|
||||
const auto &charmap = run.GetGlyphToCharMap();
|
||||
@@ -308,13 +308,13 @@ ptrdiff_t Layouter::GetCharAtPosition(int x, size_t line_index) const
|
||||
|
||||
const auto &line = this->at(line_index);
|
||||
|
||||
for (int run_index = 0; run_index < line->CountRuns(); run_index++) {
|
||||
for (size_t run_index = 0; run_index < line->CountRuns(); run_index++) {
|
||||
const ParagraphLayouter::VisualRun &run = line->GetVisualRun(run_index);
|
||||
const auto &glyphs = run.GetGlyphs();
|
||||
const auto &positions = run.GetPositions();
|
||||
const auto &charmap = run.GetGlyphToCharMap();
|
||||
|
||||
for (int i = 0; i < run.GetGlyphCount(); i++) {
|
||||
for (size_t i = 0; i < run.GetGlyphCount(); i++) {
|
||||
/* Not a valid glyph (empty). */
|
||||
if (glyphs[i] == 0xFFFF) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user