this.SelectWithMoveCaret(isSelected);
}
- double noti;
/// <summary>
/// スクロールする
/// </summary>
/// <param name="delta">ピクセル単位の値でスクロール量を指定する</param>
/// <param name="isSelected">選択状態にするなら真</param>
/// <param name="withCaret">同時にキャレットを移動させるなら真</param>
- public void ScrollByPixel(ScrollDirection dir,int delta, bool isSelected, bool withCaret)
+ public void ScrollByPixel(ScrollDirection dir,double delta, bool isSelected, bool withCaret)
{
if (this.Document.FireUpdateEvent == false)
throw new InvalidOperationException("");
return;
}
- if(dir == ScrollDirection.Up || dir == ScrollDirection.Down)
+ if(dir == ScrollDirection.Up)
+ {
+ this.View.TryScroll(0, -delta);
+ }
+ else if (dir == ScrollDirection.Down)
{
- noti += delta;
-
- if (noti < this.View.render.emSize.Height)
- return;
-
- int delta_row = (int)(noti / this.View.render.emSize.Height + 1.0);
-
- noti = 0;
-
this.View.TryScroll(0, delta);
}
if (withCaret)
{
//カーソルを適切な位置に移動させる必要がある
+ TextPoint tp = this.View.GetTextPointFromPostion(this.View.CaretLocation);
+ this.View.JumpCaret(tp.row, tp.col);
this.View.AdjustCaretAndSrc();
this.SelectWithMoveCaret(isSelected);
}