OSDN Git Service

ドラッグしながらの選択ができなくなるので元に戻した
authortest <test@yahoo.co.jp>
Wed, 23 Dec 2020 10:48:53 +0000 (19:48 +0900)
committertest <test@yahoo.co.jp>
Wed, 23 Dec 2020 10:48:53 +0000 (19:48 +0900)
UWP/FooEditEngine.UWP/FooTextBox.cs
WPF/FooEditEngine/FooTextBox.cs
Windows/FooEditEngine/FooTextBox.cs

index c26e26b..71da92f 100644 (file)
@@ -1174,6 +1174,20 @@ namespace FooEditEngine.UWP
 
         void gestureRecongnizer_Dragging(GestureRecognizer sender, DraggingEventArgs e)
         {
+            Point p = e.Position;
+            TextPointSearchRange searchRange;
+            if (this.View.HitTextArea(p.X, p.Y))
+                searchRange = TextPointSearchRange.TextAreaOnly;
+            else if (this._Controller.SelectionLength > 0)
+                searchRange = TextPointSearchRange.Full;
+            else
+                return;
+            TextPoint tp = this.View.GetTextPointFromPostion(p, searchRange);
+            this._Controller.MoveCaretAndSelect(tp, this.IsModiferKeyPressed(VirtualKey.LeftControl));
+#if ENABLE_AUTMATION
+            if (this.peer != null)
+                this.peer.OnNotifyCaretChanged();
+#endif
             this.Refresh();
         }
 
index c874899..30a3bb8 100644 (file)
@@ -975,6 +975,14 @@ namespace FooEditEngine.WPF
             {
                 this.Cursor = Cursors.Arrow;
             }
+            if (leftPressed)
+            {
+                bool controlPressed = (Keyboard.GetKeyStates(Key.LeftCtrl) & KeyStates.Down) == KeyStates.Down;
+                this._Controller.MoveCaretAndSelect(tp, controlPressed);
+                if (this.peer != null)
+                    this.peer.OnNotifyCaretChanged();
+                this.Refresh();
+            }
         }
 
         Gripper hittedGripper;
index 71dc24f..0b7c134 100644 (file)
@@ -1200,6 +1200,12 @@ namespace FooEditEngine.Windows
                     this.Cursor = Cursors.Hand;
                 else
                     this.Cursor = Cursors.IBeam;
+
+                if (e.Button == MouseButtons.Left)
+                {
+                    this.Controller.MoveCaretAndSelect(tp, ModifierKeys.HasFlag(Keys.Control));
+                    this.Refresh();
+                }
             }
             else
             {