mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 20:06:18 +08:00
Bringing over fix [r12000] from 1.3 current to the porting branch.
Applying my suggested patch to solve immediate issues with STR #3231. Probably more needs to be done (see STR), but at least solves the immediate issues. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12001 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -1027,7 +1027,9 @@ int Fl_Text_Display::position_to_xy( int pos, int* X, int* Y ) const {
|
|||||||
int lineStartPos, fontHeight;
|
int lineStartPos, fontHeight;
|
||||||
int visLineNum;
|
int visLineNum;
|
||||||
/* If position is not displayed, return false */
|
/* If position is not displayed, return false */
|
||||||
if (pos < mFirstChar || (pos > mLastChar && !empty_vlines())) {
|
if ((pos < mFirstChar) ||
|
||||||
|
(pos > mLastChar && !empty_vlines()) ||
|
||||||
|
(pos > buffer()->length()) ) { // STR #3231
|
||||||
return (*X=*Y=0); // make sure X & Y are set when it is out of view
|
return (*X=*Y=0); // make sure X & Y are set when it is out of view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user