From 8629c400be832222ebff818790736c517878d5d5 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Wed, 26 Mar 2014 02:18:07 -0400 Subject: [PATCH] ide/designer: Fixed location of controls being dropped in CodeEditor --- ecere/src/gui/controls/EditBox.ec | 2 ++ ide/src/designer/CodeEditor.ec | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ecere/src/gui/controls/EditBox.ec b/ecere/src/gui/controls/EditBox.ec index e7f49d7..959ec27 100644 --- a/ecere/src/gui/controls/EditBox.ec +++ b/ecere/src/gui/controls/EditBox.ec @@ -2870,6 +2870,7 @@ private: else SetCaret(0, 0, 0); + // TOFIX: Mismatch between NotifyCaretMove() and NotifyDropped() / GoToPosition() NotifyCaretMove(master, this, y + 1, x + 1); SelectionEnables(); @@ -5541,6 +5542,7 @@ public: return false; } + // NOTE: Mismatch with NotifyCaretMove() for x/y + 1 bool GoToPosition(EditLine line, int y, int x) { /* diff --git a/ide/src/designer/CodeEditor.ec b/ide/src/designer/CodeEditor.ec index 864780a..65e011a 100644 --- a/ide/src/designer/CodeEditor.ec +++ b/ide/src/designer/CodeEditor.ec @@ -1362,9 +1362,11 @@ class CodeEditor : Window ObjectInfo object; ObjectInfo classObject; - //editBox.NotifyCaretMove(this, editBox, y, x); editBox.GoToLineNum(y); - editBox.GoToPosition(editBox.line, y, Min(x, editBox.line.count)); + x = Min(x, editBox.line.count); + editBox.GoToPosition(editBox.line, y, x); + // Note: Uncommented this to drag objects after the member instance on which they are dropped + editBox.NotifyCaretMove(this, editBox, y+1, x+1); classObject = selected ? selected.oClass : null; -- 1.8.3.1