- this.startPoint.getX()) >= 10;
boolean zoomTrigger2 = vZoom && Math.abs(e.getY()
- this.startPoint.getY()) >= 10;
if (zoomTrigger1 || zoomTrigger2) {
Point2D endPoint = new Point2D.Double(e.getX(), e.getY());
PlotRenderingInfo pri = canvas.getRenderingInfo().getPlotInfo();
if ((hZoom && (e.getX() < this.startPoint.getX()))
|| (vZoom && (e.getY() < this.startPoint.getY()))) {
boolean saved = p.isNotify();
p.setNotify(false);
z.zoomDomainAxes(0, pri, endPoint);
z.zoomRangeAxes(0, pri, endPoint);
p.setNotify(saved);
} else {
double x = this.startPoint.getX();
double y = this.startPoint.getY();
double w = e.getX() - x;
double h = e.getY() - y;
Rectangle2D dataArea = canvas.findDataArea(this.startPoint);
double maxX = dataArea.getMaxX();
double maxY = dataArea.getMaxY();
// for mouseReleased event, (horizontalZoom || verticalZoom)
// will be true, so we can just test for either being false;
// otherwise both are true
if (!vZoom) {
y = dataArea.getMinY();
w = Math.min(w, maxX - this.startPoint.getX());
h = dataArea.getHeight();
}
else if (!hZoom) {
x = dataArea.getMinX();
w = dataArea.getWidth();
h = Math.min(h, maxY - this.startPoint.getY());
}
else {
w = Math.min(w, maxX - this.startPoint.getX());
h = Math.min(h, maxY - this.startPoint.getY());
}
Rectangle2D zoomArea = new Rectangle2D.Double(x, y, w, h);
boolean saved = p.isNotify();
p.setNotify(false);
double pw0 = percentW(x, dataArea);
double pw1 = percentW(x + w, dataArea);
double ph0 = percentH(y, dataArea);
double ph1 = percentH(y + h, dataArea);
PlotRenderingInfo info
= this.viewer.getRenderingInfo().getPlotInfo();
if (z.getOrientation().isVertical()) {
z.zoomDomainAxes(pw0, pw1, info, endPoint);
z.zoomRangeAxes(1 - ph1, 1 - ph0, info, endPoint);
} else {