From: <jam...@us...> - 2007-01-23 00:02:10
|
Revision: 23 http://svn.sourceforge.net/nplot/?rev=23&view=rev Author: jamcquay Date: 2007-01-22 16:02:09 -0800 (Mon, 22 Jan 2007) Log Message: ----------- Fixed [SF bug 1601158] The check for whether the rubberband was inbounds was only looking at the min & max points of the rubberband. The code now checks all four corner points to determine if the selection is inbounds (i.e. at least one corner is on the chart) Code fixed by: jamcquay Signed off by: jamcquay Modified Paths: -------------- trunk/src/Windows.PlotSurface2D.cs Modified: trunk/src/Windows.PlotSurface2D.cs =================================================================== --- trunk/src/Windows.PlotSurface2D.cs 2007-01-11 14:30:12 UTC (rev 22) +++ trunk/src/Windows.PlotSurface2D.cs 2007-01-23 00:02:09 UTC (rev 23) @@ -1360,8 +1360,24 @@ maxPoint.X = Math.Max(startPoint_.X, endPoint_.X); maxPoint.Y = Math.Max(startPoint_.Y, endPoint_.Y); + // We also need the point coordinates at the other two corners + // to check if the rubberband selection is inbounds + //(i.e. at least one corner is located inside the chart + Point cornerUpperRight = new Point(0, 0); + cornerUpperRight.X = Math.Max(startPoint_.X, endPoint_.X); + cornerUpperRight.Y = Math.Min(startPoint_.Y, endPoint_.Y); + + Point cornerLowerLeft = new Point(0, 0); + cornerLowerLeft.X = Math.Min(startPoint_.X, endPoint_.X); + cornerLowerLeft.Y = Math.Max(startPoint_.Y, endPoint_.Y); + Rectangle r = ps.PlotAreaBoundingBoxCache; - if (minPoint != maxPoint && (r.Contains(minPoint) || r.Contains(maxPoint))) + bool isRubberbandInbounds = r.Contains(minPoint) || + r.Contains(maxPoint) || + r.Contains(cornerUpperRight) || + r.Contains(cornerLowerLeft); + + if (isRubberbandInbounds && minPoint != maxPoint) { ((Windows.PlotSurface2D)ctr).CacheAxes(); @@ -1378,7 +1394,7 @@ return true; } - } + } return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jam...@us...> - 2007-01-25 16:42:56
|
Revision: 26 http://svn.sourceforge.net/nplot/?rev=26&view=rev Author: jamcquay Date: 2007-01-25 08:42:53 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Fixed [SF bug 1644591] Dirty flag optimizzation. Call was being processed twice in several mouse related actions. Full patch submitted via email by Pawel Konieczny Signed off by: jamcquay Modified Paths: -------------- trunk/src/Windows.PlotSurface2D.cs Modified: trunk/src/Windows.PlotSurface2D.cs =================================================================== --- trunk/src/Windows.PlotSurface2D.cs 2007-01-24 23:14:35 UTC (rev 25) +++ trunk/src/Windows.PlotSurface2D.cs 2007-01-25 16:42:53 UTC (rev 26) @@ -750,7 +750,6 @@ bool dirty = false; foreach (Interactions.Interaction i in interactions_) { - i.DoMouseDown(e,this); dirty |= i.DoMouseDown(e,this); } if (dirty) @@ -782,7 +781,6 @@ bool dirty = false; foreach (Interactions.Interaction i in interactions_) { - i.DoMouseWheel(e, this); dirty |= i.DoMouseWheel(e, this); } if (dirty) @@ -803,7 +801,6 @@ bool dirty = false; foreach (Interactions.Interaction i in interactions_) { - i.DoMouseMove(e, ctr, lastKeyEventArgs_); dirty |= i.DoMouseMove(e, ctr, lastKeyEventArgs_); } if (dirty) @@ -2444,7 +2441,7 @@ ((Windows.PlotSurface2D)ctr).CacheAxes(); - float delta = (float)e.Delta / (float)e.Delta; + float delta = (float)e.Delta / (float)SystemInformation.MouseWheelScrollDelta; delta *= sensitivity_; Axis axis = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jam...@us...> - 2007-02-20 20:20:04
|
Revision: 27 http://svn.sourceforge.net/nplot/?rev=27&view=rev Author: jamcquay Date: 2007-02-20 12:19:52 -0800 (Tue, 20 Feb 2007) Log Message: ----------- SystemInformation.MouseWheelScrollDelta is a .Net 2.0 function ONLY. Placed a compiler switch on the code inorder to compile for .Net 1.1 Modified Paths: -------------- trunk/src/Windows.PlotSurface2D.cs Modified: trunk/src/Windows.PlotSurface2D.cs =================================================================== --- trunk/src/Windows.PlotSurface2D.cs 2007-01-25 16:42:53 UTC (rev 26) +++ trunk/src/Windows.PlotSurface2D.cs 2007-02-20 20:19:52 UTC (rev 27) @@ -2441,9 +2441,12 @@ ((Windows.PlotSurface2D)ctr).CacheAxes(); +#if API_1_1 + float delta = (float)e.Delta / (float)e.Delta; +#else float delta = (float)e.Delta / (float)SystemInformation.MouseWheelScrollDelta; - delta *= sensitivity_; - +#endif + delta *= sensitivity_; Axis axis = null; PointF pMin = PointF.Empty; PointF pMax = PointF.Empty; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |