mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
*maybe* fixed crashes when typing: index was possibly out of bounds altough it should not have happened.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@345 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -194,7 +194,7 @@ RealRect TextViewer::charRect(size_t index) const {
|
||||
if (lines.empty()) return RealRect(0,0,0,0);
|
||||
const Line& l = findLine(index);
|
||||
size_t pos = index - l.start;
|
||||
if (pos >= l.positions.size()) {
|
||||
if (pos + 1 >= l.positions.size()) {
|
||||
return RealRect(l.positions.back(), l.top, 0, l.line_height);
|
||||
} else {
|
||||
return RealRect(l.positions[pos], l.top, l.positions[pos + 1] - l.positions[pos], l.line_height);
|
||||
|
||||
Reference in New Issue
Block a user