summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2016-07-15 22:57:46 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2016-07-15 22:57:46 +0200
commit71ee8eeb3fd34ca99d0ab85697a270c9d09c1ab6 (patch)
tree1a722a74cec58b29d26a587bf0da7178da467e30 /scene/gui
parent4c4ab140b4569f2700517a13b20127eb7542b3ec (diff)
LineEdit: Fix rtl scrolling with mouse drag selection
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/line_edit.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 6c47072b33..89c235e101 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -118,7 +118,7 @@ void LineEdit::_input_event(InputEvent p_event) {
const InputEventMouseMotion& m=p_event.mouse_motion;
- if (m.button_mask&1) {
+ if (m.button_mask&BUTTON_LEFT) {
if (selection.creating) {
set_cursor_at_pixel_pos(m.x);
@@ -616,11 +616,11 @@ void LineEdit::_notification(int p_what) {
} break;
case ALIGN_CENTER: {
- x_ofs=x_ofs=int(size.width-(cached_width))/2;
+ x_ofs=int(size.width-(cached_width))/2;
} break;
case ALIGN_RIGHT: {
- x_ofs=x_ofs=int(size.width-style->get_offset().x-(cached_width));
+ x_ofs=int(size.width-style->get_offset().x-(cached_width));
} break;
}
@@ -811,6 +811,9 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
if ( (pixel_ofs-p_x) < (char_w >> 1 ) ) {
ofs+=1;
+ } else if ( (pixel_ofs-p_x) > (char_w >> 1 ) ) {
+
+ ofs-=1;
}
break;