From 048fdc8aeabbd80ba9cc8914ec7f7baa00ad0c3d Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 22 Sep 2014 00:50:48 -0300 Subject: -variables with export in script are now IMMEDIATELY AND ALWAYS visible in properties (#718) -WorldEnvironment cleanup issues fixed (#563) -Text Editor improvement to shift-mouse selection (#648) -(Hopefully) fixed rare (but horrible) indexing bug in GDScript compiler (#652) -Some changes to PhysicsBody API, renamed property "active" to "sleeping", which makes more sense -Added add_collision_exception() API in PhysicsBody (more accessible) -ability to select and copy in the output messages panel --- scene/gui/text_edit.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 5934aaf126..6aabfa35a8 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -935,16 +935,40 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { if (!_get_mouse_pos(Point2i(mb.x,mb.y), row,col)) return; + int prev_col=cursor.column; + int prev_line=cursor.line; + + + cursor_set_line( row ); cursor_set_column( col ); + if (mb.mod.shift && (cursor.column!=prev_col || cursor.line!=prev_line)) { + + selection.active=true; + selection.selecting_mode=Selection::MODE_POINTER; + selection.from_column=prev_col; + selection.from_line=prev_line; + selection.to_column=cursor.column; + selection.to_line=cursor.line; + if (selection.from_column>selection.to_column) { + SWAP(selection.from_column,selection.to_column); + SWAP(selection.from_line,selection.to_line); + } + selection.selecting_line=prev_line; + selection.selecting_column=prev_col; + update(); + + } else { + //if sel active and dblick last time < something //else - selection.active=false; - selection.selecting_mode=Selection::MODE_POINTER; - selection.selecting_line=row; - selection.selecting_column=col; + selection.active=false; + selection.selecting_mode=Selection::MODE_POINTER; + selection.selecting_line=row; + selection.selecting_column=col; + } if (!mb.doubleclick && (OS::get_singleton()->get_ticks_msec()-last_dblclk)<600) { -- cgit v1.2.3