Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed recalculate button

  • Loading branch information...
commit c54d61954a9fd10df2769266a3d24f442a8e85f8 1 parent f369378
@dbyrne authored
View
10 res/layout/main_layout.xml
@@ -29,16 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:layout_height="fill_parent"/>
<Button
- android:id="@+id/recalculateButton"
- android:text="Recalculate"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_marginTop="5px"
- android:layout_marginRight="5px"/>
-
- <Button
android:id="@+id/juliaButton"
android:text="Julia Set Mode"
android:layout_width="wrap_content"
View
17 src/byrne/fractal/FractalView.java
@@ -35,7 +35,7 @@
public class FractalView extends View implements MultiTouchObjectCanvas<FractalView.Img> {
private double minY,maxY,minX,maxX;
- private Img fractalBitmap;
+ private Img fractalBitmap, backgroundBitmap;
private GenerateFractalTask mGenerateFractalTask;
private String calculationTime;
private ComplexEquation equation = ComplexEquation.SECOND_ORDER;
@@ -209,6 +209,9 @@ protected void resetCoords() {
params.setType(FractalType.MANDELBROT);
params.resetMaxIterations();
}
+
+ backgroundBitmap = null;
+
setZoom(true);
startFractalTask();
}
@@ -237,6 +240,7 @@ protected void resetCoords() {
params.setCoords(realmin, realmax, imagmin, imagmax);
params.resetMaxIterations();
+ backgroundBitmap = null;
startFractalTask();
} else if (event.getAction() == MotionEvent.ACTION_UP) {
setZoom(true);
@@ -249,7 +253,6 @@ protected void resetCoords() {
@Override
public Img getDraggableObjectAtPoint(PointInfo pt) {
- System.out.println("getDraggableObjectAtPoint:" + fractalBitmap);
return fractalBitmap;
}
@@ -258,6 +261,12 @@ public Img getDraggableObjectAtPoint(PointInfo pt) {
* getDraggableObjectAtPoint()) and a drag operation is starting. Called with null when drag op ends.
*/
@Override public void selectObject(Img img, PointInfo touchPoint) {
+ if (img == null) {
+ backgroundBitmap = fractalBitmap;
+ recalculate();
+ } else {
+ backgroundBitmap = null;
+ }
invalidate();
}
@@ -281,6 +290,10 @@ public boolean setPositionAndScale(Img img, PositionAndScale newImgPosAndScale,
@Override protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
+ if (backgroundBitmap != null) {
+ backgroundBitmap.draw(canvas);
+ }
+
if (fractalBitmap != null) {
fractalBitmap.draw(canvas);
View
7 src/byrne/fractal/Fractoid.java
@@ -71,13 +71,6 @@ public void onClick(View v) {
}
});
- final Button recalculateButton = (Button) findViewById(R.id.recalculateButton);
- recalculateButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- fractalView.recalculate();
- }
- });
-
Eula.showEula(this);
}
View
1  src/byrne/fractal/GenerateFractalTask.java
@@ -181,6 +181,7 @@ private Bitmap createBitmap() {
final int PASSES = 4;
for (int rpass = 0; rpass < PASSES; rpass++) {
+
for (int row=rpass; row < yres; row += PASSES) {
if (row % 5 == 0) {
if (isCancelled())
Please sign in to comment.
Something went wrong with that request. Please try again.