|
commit 1b6ce059036c8576f8c8fbb8c6e265582be7a670
Author: YX <yxxinyuan@zju.edu.cn>
AuthorDate: Sat Oct 9 11:36:43 2021 +0800
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon Dec 13 08:20:03 2021 +0100
Fix IME problem (issue #270)
src/Fl_Input_.cxx | 4 +++-
src/Fl_Text_Display.cxx | 5 +++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git src/Fl_Input_.cxx src/Fl_Input_.cxx
index 175f1ac..b8a0739 100644
--- src/Fl_Input_.cxx
+++ src/Fl_Input_.cxx
@@ -291,6 +291,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
int desc = height-fl_descent();
float xpos = (float)(X - xscroll_ + 1);
int ypos = -yscroll_;
+ int ypos_cur = 0; // fix issue #270
for (; ypos < H;) {
// re-expand line unless it is the last one calculated above:
@@ -391,6 +392,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
#ifdef __APPLE__
Fl::insertion_point_location(xpos+curx, Y+ypos+height, height);
#endif
+ ypos_cur = ypos+height; //fix issue #270
}
CONTINUE:
@@ -413,7 +415,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
fl_pop_clip();
if (Fl::focus() == this) {
fl_set_spot(textfont(), textsize(),
- (int)xpos+curx, Y+ypos-fl_descent(), W, H, window());
+ (int)xpos+curx, Y+ypos_cur-fl_descent(), W, H, window()); //fix issue #270
}
}
diff --git src/Fl_Text_Display.cxx src/Fl_Text_Display.cxx
index 6a4d749..da443d6 100644
--- src/Fl_Text_Display.cxx
+++ src/Fl_Text_Display.cxx
@@ -2402,6 +2402,11 @@ void Fl_Text_Display::draw_cursor( int X, int Y ) {
for ( int k = 0; k < nSegs; k++ ) {
fl_line( segs[ k ].x1, segs[ k ].y1, segs[ k ].x2, segs[ k ].y2 );
}
+
+ // fix issue #270
+ if (Fl::focus() == this) {
+ fl_set_spot(textfont(), textsize(), X, bot, text_area.w, text_area.h, window());
+ }
}
[ Direct Link to Message ] | |