/// <summary> /// /// </summary> private static Rect2D CalcRect(ScrollBar scrollBar, int value, IRectCalc rectCalc) { var top = convertValueToPosition(value); var bottom = convertValueToPosition(value + 1); return(rectCalc.CalcRect(top, bottom)); // スクロール値を座標に変換する int convertValueToPosition(int value) { return(scrollBar.IsThumbEnabled ? scrollBar.Body.Thumb.ConvertValueToPosition(value) : MathUtil.TruncateToInt32(scrollBar.Body.BodyPixels / (double)scrollBar.ViewportLength * value)); } }
public SolidRectMarker(IRectCalc rectCalc, Color color) { _rectCalc = rectCalc; _color = color; }