OSDN Git Service

メトロ版でドキュメントの終わりまでスクロールした時の挙動がおかしかった
authorkonekoneko <test2214@hotmail.co.jp>
Mon, 16 May 2016 08:35:21 +0000 (17:35 +0900)
committerkonekoneko <test2214@hotmail.co.jp>
Mon, 16 May 2016 08:35:21 +0000 (17:35 +0900)
Core/ViewBase.cs

index afbf15a..0a41290 100644 (file)
@@ -310,9 +310,9 @@ namespace FooEditEngine
 
             noti = 0;
 
-            double totalHeight = this.LayoutLines.Count * this.render.emSize.Height;
+            double totalHeight = this.LayoutLines.Count * this.render.emSize.Height - this.render.TextArea.Height;
             if (total.Y > totalHeight)
-                total.Y = totalHeight - this.render.TextArea.Height;
+                total.Y = totalHeight;
             if (total.Y < 0)
                 total.Y = 0;
             if (total.X < 0)
@@ -325,8 +325,9 @@ namespace FooEditEngine
                 row = 0;    //0の時だけは切り上げると困るので何もしない
             if (row < 0)
                 return true;
-            if (row > this.LayoutLines.Count - 1)
-                return true;
+            int totalRow = this.LayoutLines.Count - 1 - this.LineCountOnScreen;
+            if (row > totalRow)
+                row = totalRow;
             this.Document.Src = new SrcPoint(total.X, row, total.Y);
             this.SrcChanged(this, null);