From 0c6ad247ddec015919deb8ffaddbc2f4121c848e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 29 Dec 2012 11:58:49 +0000 Subject: Display the moving insertion point when doing drag&drop to an Fl_Text_Display widget from the widget itself. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9781 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Display.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 5c418fc7d..5f086eaa2 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -3468,12 +3468,14 @@ void Fl_Text_Display::draw(void) { } // draw the text cursor + int start, end; + int has_selection = buffer()->selection_position(&start, &end); if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE) && ( #ifdef __APPLE__ Fl::marked_text_length() || #endif - !buffer()->primary_selection()->selected()) && + !has_selection || mCursorPos < start || mCursorPos > end) && mCursorOn && Fl::focus() == (Fl_Widget*)this ) { fl_push_clip(text_area.x-LEFT_MARGIN, text_area.y, -- cgit v1.2.3