Test wxTextCtrl::HitTest() with negative coordinates under wxGTK

In wxGTK using negative coordinates with HitTest() happens to work and
it's useful to test that it does, as this test will run when the control
is scrolled even under Travis CI, unlike the test with positive
coordinates which doesn't work under Xvfb there and was disabled in the
previous commit.

Also document that passing negative coordinates to this function only
works in wxGTK.
This commit is contained in:
Vadim Zeitlin
2019-07-17 22:15:03 +02:00
parent cfb12091ca
commit 5bd9c5b65b
2 changed files with 9 additions and 0 deletions

View File

@@ -392,6 +392,13 @@ void TextCtrlTestCase::HitTestSingleLine()
REQUIRE( m_text->HitTest(wxPoint(2*sizeChar.x, yMid), &pos) == wxTE_HT_ON_TEXT );
CHECK( pos > 3 );
}
// Using negative coordinates works even under Xvfb, so test at least
// for this -- however this only works in wxGTK, not wxMSW.
#ifdef __WXGTK__
REQUIRE( m_text->HitTest(wxPoint(-2*sizeChar.x, yMid), &pos) == wxTE_HT_ON_TEXT );
CHECK( pos > 3 );
#endif // __WXGTK__
}
#endif
}