Fix XYToPosition() for the last position in first line in wxGTK
This is similar to e74fb5effe
for wxMSW
and ensures that we don't consider the last position on the first line
invalid in wxGTK neither.
This fixes TextCtrlTestCase::XYToPositionSingleLine() unit test failure.
This commit is contained in:
@@ -1192,8 +1192,7 @@ long wxTextCtrl::XYToPosition(long x, long y ) const
|
|||||||
{
|
{
|
||||||
if ( IsSingleLine() )
|
if ( IsSingleLine() )
|
||||||
{
|
{
|
||||||
|
if ( y != 0 || x > GTKGetEntryTextLength(GTK_ENTRY(m_text)) )
|
||||||
if ( y != 0 || x >= GTKGetEntryTextLength(GTK_ENTRY(m_text)) )
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
|
Reference in New Issue
Block a user