diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -260,8 +260,7 @@ Point Layouter::GetCharPosition(std::str for (int i = 0; i < run.GetGlyphCount(); i++) { /* Matching glyph? Return position. */ if ((size_t)charmap[i] == index) { - Point p = { (int)positions[i * 2], (int)positions[i * 2 + 1] }; - return p; + return positions[i]; } } } @@ -291,8 +290,8 @@ ptrdiff_t Layouter::GetCharAtPosition(in /* Not a valid glyph (empty). */ if (glyphs[i] == 0xFFFF) continue; - int begin_x = (int)positions[i * 2]; - int end_x = (int)positions[i * 2 + 2]; + int begin_x = positions[i].x; + int end_x = positions[i + 1].x; if (IsInsideMM(x, begin_x, end_x)) { /* Found our glyph, now convert to UTF-8 string index. */