OSDN Git Service

タッチでの選択の挙動もマウスと同じにした
authorkonekoneko <test2214@hotmail.co.jp>
Thu, 28 Jul 2016 17:47:36 +0000 (02:47 +0900)
committerkonekoneko <test2214@hotmail.co.jp>
Thu, 28 Jul 2016 17:47:36 +0000 (02:47 +0900)
Core/Controller.cs

index 4df64bf..378faf3 100644 (file)
@@ -734,9 +734,17 @@ namespace FooEditEngine
 
             if (HittedCaret || hittedGripper != null)
             {
+                TextPointSearchRange searchRange;
+                if (this.View.HitTextArea(p.X, p.Y))
+                    searchRange = TextPointSearchRange.TextAreaOnly;
+                else if (this.SelectionLength > 0)
+                    searchRange = TextPointSearchRange.Full;
+                else
+                    return false;
+
                 if (hittedGripper != null)
                 {
-                    tp = this.View.GetTextPointFromPostion(hittedGripper.AdjustPoint(p));
+                    tp = this.View.GetTextPointFromPostion(hittedGripper.AdjustPoint(p), searchRange);
                     if (tp == TextPoint.Null)
                         return false;
                     if (this.IsReverseSelect())
@@ -757,7 +765,7 @@ namespace FooEditEngine
                 }
                 else
                 {
-                    tp = this.View.GetTextPointFromPostion(p);
+                    tp = this.View.GetTextPointFromPostion(p, searchRange);
                     if (tp != TextPoint.Null)
                     {
                         this.MoveCaretAndSelect(tp);