@@ -1072,6 +1072,7 @@ void TextEditInput::setCursorRow(int row) {
10721072}
10731073
10741074void TextEditInput::clicked (int x, int y, bool pressed) {
1075+ FormEditInput::clicked (x, y, pressed);
10751076 if (x < _marginWidth) {
10761077 _ptY = -1 ;
10771078 } else if (pressed) {
@@ -1080,7 +1081,7 @@ void TextEditInput::clicked(int x, int y, bool pressed) {
10801081 _state.select_start = wordStart ();
10811082 _state.select_end = wordEnd ();
10821083 } else {
1083- stb_textedit_click (&_buf, &_state, x - _marginWidth, y + (_scroll * _charHeight));
1084+ stb_textedit_click (&_buf, &_state, ( x - _x) - _marginWidth, (y - _y) + (_scroll * _charHeight));
10841085 }
10851086 _pressTick = tick;
10861087 }
@@ -1106,17 +1107,17 @@ bool TextEditInput::updateUI(var_p_t form, var_p_t field) {
11061107}
11071108
11081109bool TextEditInput::selected (MAPoint2d pt, int scrollX, int scrollY, bool &redraw) {
1109- bool focus = hasFocus ( );
1110- if (focus ) {
1110+ bool result = FormEditInput::selected (pt, scrollX, scrollY, redraw );
1111+ if (hasFocus () ) {
11111112 if (pt.x < _marginWidth) {
11121113 dragPage (pt.y , redraw);
11131114 } else {
1114- stb_textedit_drag (&_buf, &_state, pt.x - _marginWidth,
1115- pt.y + scrollY + (_scroll * _charHeight));
1115+ stb_textedit_drag (&_buf, &_state, ( pt.x - _x) - _marginWidth,
1116+ ( pt.y - _y) + scrollY + (_scroll * _charHeight));
11161117 redraw = true ;
11171118 }
11181119 }
1119- return focus ;
1120+ return result ;
11201121}
11211122
11221123void TextEditInput::selectNavigate (bool up) {
@@ -2043,8 +2044,8 @@ void TextEditHelpWidget::completeWord(int pos) {
20432044void TextEditHelpWidget::clicked (int x, int y, bool pressed) {
20442045 _ptY = -1 ;
20452046 if (pressed) {
2046- stb_textedit_click (&_buf, &_state, 0 , y + (_scroll * _charHeight));
2047- if (_mode == kHelpKeyword && x - _x <= _charWidth * 3 ) {
2047+ stb_textedit_click (&_buf, &_state, 0 , (y - _y) + (_scroll * _charHeight));
2048+ if (_mode == kHelpKeyword && ( x - _x) <= _charWidth * 3 ) {
20482049 toggleKeyword ();
20492050 }
20502051 }
0 commit comments