|
|
@@ -300,11 +300,17 @@ public class Terrain extends JPanel {
|
|
|
super.paintComponent(g);
|
|
|
Graphics2D g2 = (Graphics2D) g;
|
|
|
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
|
|
|
- topbar.draw(g2, getWidth());
|
|
|
+ topbar.draw(g2, getWidth());
|
|
|
sidebar.draw(g2);
|
|
|
|
|
|
//draw simulation field
|
|
|
- g2.setClip(new Rectangle2D.Double(sideBarWidth, 0, getWidth()-sideBarWidth, getHeight()));
|
|
|
+ Area a1 = new Area(new Rectangle2D.Double(sideBarWidth, 0, getWidth()-sideBarWidth, getHeight()));
|
|
|
+ Area a2 = new Area(topbar.getBackground());
|
|
|
+ a2.transform(new AffineTransform().getTranslateInstance(1, 1.2));
|
|
|
+ a1.subtract(a2);
|
|
|
+
|
|
|
+ g2.setClip(a1);
|
|
|
+ //g2.setClip(new Rectangle2D.Double(sideBarWidth, 0, getWidth()-sideBarWidth, getHeight()));
|
|
|
AffineTransform oldTransform = g2.getTransform();
|
|
|
g2.translate(sideBarWidth,0);
|
|
|
g2.setTransform(getCamera());
|
|
|
@@ -321,6 +327,7 @@ public class Terrain extends JPanel {
|
|
|
g2.drawLine(0, i*10, getFestivalWidth(), i*10);
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
if(pathgenerate > 1){
|
|
|
g2.setStroke(new BasicStroke(10));
|
|
|
currentpath.paint(g2);
|
|
|
@@ -361,7 +368,6 @@ public class Terrain extends JPanel {
|
|
|
g2.setColor(new Color(0, 254, 0, 128));
|
|
|
}
|
|
|
g2.fill(this.selectedObject.getAffineTransform().createTransformedShape(this.selectedObject.getRect()));
|
|
|
- g2.setClip(null);
|
|
|
g2.setTransform(oldTransform);
|
|
|
}
|
|
|
}
|