From: kruland2607 Date: Fri, 6 Jan 2012 03:31:27 +0000 (+0000) Subject: Enabled pan and zoom. Once the y axis were pinned so their origins are the same... X-Git-Tag: upstream/12.03~1^2~194 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=8abb726e872b56c65e29071cfec89016a836f720;p=debian%2Fopenrocket Enabled pan and zoom. Once the y axis were pinned so their origins are the same location, the pan and zoom feels better. Though there are still some bugs in there. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@276 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/src/net/sf/openrocket/android/simulation/SimulationChart.java b/src/net/sf/openrocket/android/simulation/SimulationChart.java index 75d5dde1..20bab823 100644 --- a/src/net/sf/openrocket/android/simulation/SimulationChart.java +++ b/src/net/sf/openrocket/android/simulation/SimulationChart.java @@ -95,6 +95,10 @@ public class SimulationChart { */ public Intent execute(Context context) { + /* + * TODO - + * Figure out why you can pan all over the place even where there are no visible points. + */ int seriesCount = 2; // if the same series is selected twice, only plot it once. if ( series1 == series2 ) { @@ -111,7 +115,7 @@ public class SimulationChart { renderer.setXLabels(10); renderer.setYLabels(10); renderer.setShowGrid(true); - //renderer.setZoomButtonsVisible(true); + renderer.setZoomButtonsVisible(true); renderer.setChartTitle("Simulation"); renderer.setMargins(new int[] { 50, 30, 0, 20 }); @@ -122,6 +126,8 @@ public class SimulationChart { r.setPointStyle(styles[i]); r.setFillPoints(true); renderer.addSeriesRenderer(r); + // setting the YAximMin to 0 locks the origins. + renderer.setYAxisMin(0.0, i); } } @@ -158,9 +164,7 @@ public class SimulationChart { renderer.setXAxisMax(xmax); renderer.setYAxisMax(ymax); - // Don't allow pan & zoom just yet. - renderer.setPanEnabled(false,false); - renderer.setZoomEnabled(false,false); + // These configurations don't really work well just now. //renderer.setPanLimits(new double[] { xmin, xmax, ymin, ymax }); //renderer.setZoomLimits(new double[] { xmin, xmax, ymin, ymax });