OSDN Git Service

タッチ周りの挙動をメトロ版と同じにした
authorkonekoneko <test2214@hotmail.co.jp>
Fri, 29 Jul 2016 08:52:12 +0000 (17:52 +0900)
committerkonekoneko <test2214@hotmail.co.jp>
Fri, 29 Jul 2016 08:52:12 +0000 (17:52 +0900)
WPF/FooEditEngine/FooTextBox.cs

index 0bcfdab..6819c6a 100644 (file)
@@ -950,11 +950,13 @@ namespace FooEditEngine.WPF
         {
             var p = this.GetDipFromPoint(e.GetTouchPoint(this).Position);
             this.hittedGripper = this.View.HitGripperFromPoint(p);
+            this.CaptureTouch(e.TouchDevice);
         }
 
         /// <inheritdoc/>
         protected override void OnTouchUp(TouchEventArgs e)
         {
+            this.ReleaseTouchCapture(e.TouchDevice);
             if(this.hittedGripper != null || this.touchScrolled)
             {
                 this.hittedGripper = null;
@@ -1019,12 +1021,9 @@ namespace FooEditEngine.WPF
             {
                 int deltay = (int)Math.Abs(Math.Ceiling(translation.Y));
                 if (translation.Y < 0)
-                    this._Controller.Scroll(ScrollDirection.Down, deltay, false, false);
+                    this._Controller.ScrollByPixel(ScrollDirection.Down, deltay, false, false);
                 else
-                    this._Controller.Scroll(ScrollDirection.Up, deltay, false, false);
-                this.View.IsFocused = false;
-                this.Document.SelectGrippers.BottomLeft.Enabled = false;
-                this.Document.SelectGrippers.BottomRight.Enabled = false;
+                    this._Controller.ScrollByPixel(ScrollDirection.Up, deltay, false, false);
                 this.touchScrolled = true;
                 this.Refresh();
                 return;
@@ -1037,8 +1036,6 @@ namespace FooEditEngine.WPF
                     this._Controller.Scroll(ScrollDirection.Left, deltax, false, false);
                 else
                     this._Controller.Scroll(ScrollDirection.Right, deltax, false, false);
-                this.Document.SelectGrippers.BottomLeft.Enabled = false;
-                this.Document.SelectGrippers.BottomRight.Enabled = false;
                 this.touchScrolled = true;
                 this.Refresh();
             }