Fix issue with observers.

This commit is contained in:
Holt59
2018-03-03 18:21:16 +01:00
parent bcfc8dac3d
commit 89b6bc5819
4 changed files with 11 additions and 4 deletions

View File

@@ -154,6 +154,7 @@ public class BasicDrawing extends JPanel implements Drawing {
this.points = points;
this.origin = origin;
this.destination = destination;
this.color = color;
}
@Override
@@ -217,7 +218,7 @@ public class BasicDrawing extends JPanel implements Drawing {
@Override
public void setWidth(int width) {
this.width = width;
this.width = Math.max(2, width);
}
@Override
@@ -228,7 +229,6 @@ public class BasicDrawing extends JPanel implements Drawing {
@Override
public void addPoint(Point point) {
this.width = 5;
int x = BasicDrawing.this.projx(point.getLongitude()) - this.width / 2;
int y = BasicDrawing.this.projy(point.getLatitude()) - this.width / 2;
this.graphics.fillOval(x, y, this.width, this.width);

View File

@@ -1,5 +1,6 @@
package org.insa.graphics.drawing.components;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
@@ -173,6 +174,8 @@ public class MapZoomControls {
g.drawImage(zoomOut, xoffset, yoffset, observer);
zoomOutRect.setBounds(xoffset, yoffset, DEFAULT_HEIGHT, DEFAULT_HEIGHT);
g.setStroke(new BasicStroke(1));
// Draw ticks
xoffset += DEFAULT_HEIGHT + 2;
g.setColor(ZOOM_TICK_COLOR);