Set default transform to ZoomAndPanListener to avoid bunch of exceptions.
This commit is contained in:
parent
6cc57631ad
commit
55e4f4dfdc
@ -8,6 +8,7 @@ import java.awt.Image;
|
|||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
|
import java.awt.geom.AffineTransform;
|
||||||
import java.awt.geom.NoninvertibleTransformException;
|
import java.awt.geom.NoninvertibleTransformException;
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
@ -288,6 +289,9 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
this.addMouseListener(zoomAndPanListener);
|
this.addMouseListener(zoomAndPanListener);
|
||||||
this.addMouseMotionListener(zoomAndPanListener);
|
this.addMouseMotionListener(zoomAndPanListener);
|
||||||
this.addMouseWheelListener(zoomAndPanListener);
|
this.addMouseWheelListener(zoomAndPanListener);
|
||||||
|
|
||||||
|
// Avoid bunch of NullPointerException
|
||||||
|
this.zoomAndPanListener.setCoordTransform(new AffineTransform());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user