From 1c4e8377b74706b877043e259c2b7cfdbe1ff29d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Nov 2017 03:42:23 +0100 Subject: [PATCH] Fix XYToPosition() for the last position in first line in wxGTK This is similar to e74fb5effe6542340af85d50970787c133a911af 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. --- src/gtk/textctrl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index c3d56aaee2..255544eeda 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1192,8 +1192,7 @@ long wxTextCtrl::XYToPosition(long x, long y ) const { if ( IsSingleLine() ) { - - if ( y != 0 || x >= GTKGetEntryTextLength(GTK_ENTRY(m_text)) ) + if ( y != 0 || x > GTKGetEntryTextLength(GTK_ENTRY(m_text)) ) return -1; return x;