From: test Date: Thu, 7 Jan 2021 15:21:32 +0000 (+0900) Subject: キャレットが画面がにはみ出た時の挙動を以前のに戻した X-Git-Url: http://git.osdn.net/view?p=fooeditengine%2FFooEditEngine.git;a=commitdiff_plain;h=450b22e9241eea1a294b4eb819114baa89cd67a8 キャレットが画面がにはみ出た時の挙動を以前のに戻した --- diff --git a/Core/EditView.cs b/Core/EditView.cs index 35dc3de..ee52526 100644 --- a/Core/EditView.cs +++ b/Core/EditView.cs @@ -501,7 +501,7 @@ namespace FooEditEngine /// /// 指定した座標の一番近くにあるTextPointを取得する /// - /// テキストエリアを左上とする相対位置 + /// ビューエリアを左上とする相対位置 /// 探索範囲 /// レイアウトラインを指し示すTextPoint 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;