Error in MouseMove
Posted: Mon Dec 03, 2007 3:32 pm
Hi,
There is an error in Chart.DoMouseMove
The line sould be removed. this causes a very sluggish panning behaviour if you move the mouse to x/y coordinate lower than the x/y coordinate the mouse was on mouse down.
you can try it in the following example:
Welcome !\New in Zoom and Scroll\Modifier Keys
stefan
There is an error in Chart.DoMouseMove
Code: Select all
public virtual void DoMouseMove(int x, int y, ref Cursor c)
{
if (!this.CancelMouse)
{
if ((this.zoom != null) && this.zoom.Active)
{
if (this.zoom.Direction == ZoomDirections.Vertical)
{
x = this.ChartRect.Right;
}
if (this.zoom.Direction == ZoomDirections.Horizontal)
{
y = this.ChartRect.Bottom;
}
if ((x != this.zoom.x1) || (y != this.zoom.y1))
{
this.zoom.Draw();
this.zoom.x1 = x;
this.zoom.y1 = y;
this.zoom.Draw();
}
}
else if ((this.panning != null) && this.panning.Active)
{
if (!this.ChartRect.Contains(x, y))
{
this.panning.Active = false;
}
else if ((x != this.panning.x1) || (y != this.panning.y1))
{
bool panned = false;
/*=>*/ this.panning.Check(); /* REMOVE THIS LINE!*/
if (this.restoredAxisScales)
{
this.savedScales = this.SaveScales();
this.restoredAxisScales = false;
}
this.PanAxis(true, x, this.panning.x1, ref panned);
this.PanAxis(false, y, this.panning.y1, ref panned);
this.panning.x1 = x;
this.panning.y1 = y;
if (panned)
{
if (this.parent != null)
{
this.parent.DoScroll(this, EventArgs.Empty);
}
this.Invalidate();
}
}
}
else
{
this.CheckMouseSeries(ref c, x, y);
}
}
}
Code: Select all
this.panning.Check()
you can try it in the following example:
Welcome !\New in Zoom and Scroll\Modifier Keys
stefan