OSDN Git Service

スクロール時にキャレットまで動かすとメモリーを食うし、遅くなるのでキャレットを動かさないようにした
authortest <test@yahoo.co.jp>
Wed, 16 Dec 2020 11:41:20 +0000 (20:41 +0900)
committertest <test@yahoo.co.jp>
Wed, 16 Dec 2020 11:41:20 +0000 (20:41 +0900)
Core/EditView.cs
UWP/FooEditEngine.UWP/FooTextBox.cs
WPF/FooEditEngine/FooTextBox.cs
Windows/FooEditEngine/FooTextBox.cs

index 341c1c6..593955c 100644 (file)
@@ -605,6 +605,9 @@ namespace FooEditEngine
         {
             if (tp.row < this.Src.Row)
                 return Rectangle.Empty;
+            //画面外にある時は計算する必要がそもそもない
+            if (tp.row - this.Src.Row > this.LineCountOnScreen)
+                return Rectangle.Empty;
             double radius = width / 2;
             Point point = this.GetPostionFromTextPoint(tp);
             double lineHeight = this.render.emSize.Height;
index 71da92f..c26e26b 100644 (file)
@@ -1174,20 +1174,6 @@ 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 2a65a0f..c874899 100644 (file)
@@ -931,16 +931,25 @@ namespace FooEditEngine.WPF
 
             TextPointSearchRange searchRange;
             if (this.View.HitTextArea(p.X, p.Y))
+            {
                 searchRange = TextPointSearchRange.TextAreaOnly;
+            }
             else if (leftPressed)
+            {
                 searchRange = TextPointSearchRange.Full;
+            }
             else
-                searchRange = TextPointSearchRange.TextAreaOnly;
+            {
+                this.Cursor = Cursors.Arrow;
+                base.OnMouseMove(e);
+                return;
+            }
 
             TextPoint tp = this.View.GetTextPointFromPostion(p, searchRange);
 
             if (tp == TextPoint.Null)
             {
+                this.Cursor = Cursors.Arrow;
                 base.OnMouseMove(e);
                 return;
             }
@@ -966,15 +975,6 @@ 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 0b7c134..71dc24f 100644 (file)
@@ -1200,12 +1200,6 @@ 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
             {