OSDN Git Service

キャレットが画面がにはみ出た時の挙動を以前のに戻した
[fooeditengine/FooEditEngine.git] / Core / EditView.cs
index 35dc3de..ee52526 100644 (file)
@@ -501,7 +501,7 @@ namespace FooEditEngine
         /// <summary>
         /// 指定した座標の一番近くにあるTextPointを取得する
         /// </summary>
-        /// <param name="p">ã\83\86ã\82­ã\82¹ã\83\88エリアを左上とする相対位置</param>
+        /// <param name="p">ã\83\93ã\83¥ã\83¼エリアを左上とする相対位置</param>
         /// <param name="searchRange">探索範囲</param>
         /// <returns>レイアウトラインを指し示すTextPoint</returns>
         public TextPoint GetTextPointFromPostion(Point p,TextPointSearchRange searchRange = TextPointSearchRange.TextAreaOnly)
@@ -767,13 +767,12 @@ namespace FooEditEngine
                 }
                 else if(caret_y >= alignedHeight)
                 {
-                    double caretYFromTextArea = alignedHeight;
-                    var newsrc = this.GetNearstRowAndOffsetY(tp.row, -caretYFromTextArea);
+                    var newsrc = this.GetNearstRowAndOffsetY(tp.row, -(alignedHeight - relPoint.Y));
                     if(newsrc == null)
                         this.Document.Src = new SrcPoint(this.Src.X, tp.row, 0);
                     else
                         this.Document.Src = new SrcPoint(this.Src.X, newsrc.Item1, -newsrc.Item2);
-                    y = caretYFromTextArea;
+                    y = alignedHeight;
                 }
                 y += this.render.TextArea.Y;
                 result = true;