diff options
author | Tor Norbye <tnorbye@google.com> | 2011-02-04 09:07:27 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-02-04 09:48:47 -0800 |
commit | cfd04ede0d3230a91e0096c5b7c80d3bc76a1f6b (patch) | |
tree | af17979023d8841713e6c30856ecf9c595bbe5c3 /draw9patch/src | |
parent | e1e78fe1f5767925a6d411270064e434758250ec (diff) | |
download | sdk-cfd04ede0d3230a91e0096c5b7c80d3bc76a1f6b.zip sdk-cfd04ede0d3230a91e0096c5b7c80d3bc76a1f6b.tar.gz sdk-cfd04ede0d3230a91e0096c5b7c80d3bc76a1f6b.tar.bz2 |
Prevent java.lang.ArithmeticException in draw9patch
Initialize the zoom field to 1 instead of the default 0 since
I ran into a scenario where a division by an uninitialized zoom
caused a divide by zero exception.
Exception in thread "AWT-EventQueue-0" java.lang.ArithmeticException:
/ by zero
at com.android.draw9patch.ui.ImageEditorPanel$ImageViewer.checkLockedR
egion(ImageEditorPanel.java:894)
at com.android.draw9patch.ui.ImageEditorPanel$ImageViewer.access$1800(
ImageEditorPanel.java:646)
at com.android.draw9patch.ui.ImageEditorPanel$ImageViewer$3.mouseMoved
(ImageEditorPanel.java:745)
at java.awt.Component.processMouseMotionEvent(Component.java:6397)
Change-Id: I7d2252f07458864d591be91636477ace4b520855
Diffstat (limited to 'draw9patch/src')
-rw-r--r-- | draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java b/draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java index 1afc2ce..e0aa026 100644 --- a/draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java +++ b/draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java @@ -655,7 +655,7 @@ class ImageEditorPanel extends JPanel { private static final double STRIPES_SPACING = 6.0; private static final int STRIPES_ANGLE = 45; - private int zoom; + private int zoom = DEFAULT_ZOOM; private boolean showPatches; private boolean showLock = true; |