Merge branch 'master' into jgrpp
# Conflicts: # src/core/bitmath_func.cpp # src/core/bitmath_func.hpp # src/core/geometry_type.hpp # src/game/game_text.hpp # src/graph_gui.cpp # src/pathfinder/npf/npf.cpp # src/script/api/script_text.cpp # src/spritecache.cpp # src/track_func.h
This commit is contained in:
@@ -263,8 +263,7 @@ Point Layouter::GetCharPosition(std::string_view::const_iterator ch) const
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -295,8 +294,8 @@ ptrdiff_t Layouter::GetCharAtPosition(int x, size_t line_index) const
|
||||
/* 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. */
|
||||
|
Reference in New Issue
Block a user