diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs index 28366ed5eb..6ed67e3ac5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs @@ -28,10 +28,8 @@ using System; using System.Collections; -using System.Collections.Generic; using Gtk; using Gdk; -using Mono.TextEditor; namespace MonoDevelop.Components.Chart { @@ -577,9 +575,9 @@ namespace MonoDevelop.Components.Chart win.DrawLine (gc, px, top + height, px, top + height - tick); } } - else {
- if (Math.Abs ((long)lastPos - (long)py) < minTickStep || py < top || py > top + height)
- continue;
+ else { + if (Math.Abs ((long)lastPos - (long)py) < minTickStep || py < top || py > top + height) + continue; lastPos = py; bool labelFits = false; @@ -780,32 +778,32 @@ namespace MonoDevelop.Components.Chart } void GetPoint (double wx, double wy, out double x, out double y) - {
- unchecked {
- if (reverseXAxis)
- x = left + width - (((wx - startX) * ((double) width)) / (endX - startX));
- else
- x = left + (((wx - startX) * ((double) width)) / (endX - startX));
-
- if (reverseYAxis)
- y = top + ((wy - startY) * ((double) height) / (endY - startY));
- else
- y = top + height - ((wy - startY) * ((double) height) / (endY - startY));
+ { + unchecked { + if (reverseXAxis) + x = left + width - (((wx - startX) * ((double) width)) / (endX - startX)); + else + x = left + (((wx - startX) * ((double) width)) / (endX - startX)); + + if (reverseYAxis) + y = top + ((wy - startY) * ((double) height) / (endY - startY)); + else + y = top + height - ((wy - startY) * ((double) height) / (endY - startY)); } } void GetValue (int x, int y, out double wx, out double wy) - {
- unchecked {
- if (reverseXAxis)
- wx = startX + ((double) (left + width - 1 - x)) * (endX - startX) / (double) width;
- else
- wx = startX + ((double) (x - left)) * (endX - startX) / (double) width;
-
- if (reverseYAxis)
- wy = startY + ((double) (top + y)) * (endY - startY) / (double) height;
- else
- wy = startY + ((double) (top + height - y - 1)) * (endY - startY) / (double) height;
+ { + unchecked { + if (reverseXAxis) + wx = startX + ((double) (left + width - 1 - x)) * (endX - startX) / (double) width; + else + wx = startX + ((double) (x - left)) * (endX - startX) / (double) width; + + if (reverseYAxis) + wy = startY + ((double) (top + y)) * (endY - startY) / (double) height; + else + wy = startY + ((double) (top + height - y - 1)) * (endY - startY) / (double) height; } } |