diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-09-22 00:50:48 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-09-22 00:50:48 -0300 |
commit | 048fdc8aeabbd80ba9cc8914ec7f7baa00ad0c3d (patch) | |
tree | ddd39a348b41cfe3927075a8c6b11aa692511518 /scene/gui | |
parent | f195bf673fa8f282d2508e20ca6f08260c4e1fe7 (diff) |
-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
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
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) { |