public void Update() { if (ScrollEvent != null) { ScrollEvent(); } //마우스 입력 처리 if (Cursor.IsDragging(Bar) || (Cursor.JustdidLeftClick() && Cursor.IsOn(Frame))) { if (isVertical) { Bar.SetCenter(new Point(Bar.GetPos().X, Cursor.GetPos().Y)); } else { Bar.SetCenter(new Point(Cursor.GetPos().X, Bar.GetPos().Y)); } } //바가 범위를 벗어나지 않도록 조정. if (isVertical) { if (Bar.GetPos().Y < Frame.GetPos().Y) { Bar.SetPos(Frame.GetPos()); } if (Bar.GetPos().Y > Frame.GetPos().Y + Interval) { Bar.SetPos(Bar.GetPos().X, Frame.GetPos().Y + Interval); } Bar.SetPos(Frame.GetPos().X, Bar.GetPos().Y); } else { if (Bar.GetPos().X < Frame.GetPos().X) { Bar.SetPos(Frame.GetPos()); } if (Bar.GetPos().X > Frame.GetPos().X + Interval) { Bar.SetPos(Frame.GetPos().X + Interval, Bar.GetPos().Y); } Bar.SetPos(Bar.GetPos().X, Frame.GetPos().Y); } //계수조정. if (isVertical) { Coefficient = 1 - (Bar.GetPos().Y - Frame.GetPos().Y) / (float)Interval; } else { Coefficient = (Bar.GetPos().X - Frame.GetPos().X) / (float)Interval; } }
public static void SetPos(int x, int y) { mouseLayer.SetPos(x, y); }
public void SetPos(int x, int y) { Frame.SetPos(x, y); MenuPositionUpdate(); }
public void AttachTo(DrawingLayer d) { drawingLayer.SetPos(Method2D.Add(d.GetBound().Location, Vector)); }