import java.awt.Graphics;
import java.awt.Point;
import java.awt.Polygon;
+import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
* possible de fermer la fenêtre via le gestionnaire de fenêtres.
*
* @author Arnaud Giersch <arnaud.giersch@univ-fcomte.fr>
- * @version 20141021b
+ * @version 20141104
*/
public class DrawingWindow {
synchronized (image) {
graphics.drawPolygon(poly);
}
- panel.repaint(poly.getBounds());
+ Rectangle bounds = poly.getBounds();
+ bounds.setSize(bounds.width + 1, bounds.height + 1);
+ panel.repaint(bounds);
}
/**
graphics.drawPolygon(poly);
graphics.fillPolygon(poly);
}
+ Rectangle bounds = poly.getBounds();
+ bounds.setSize(bounds.width + 1, bounds.height + 1);
panel.repaint(poly.getBounds());
}
<h2>Modifications</h2>
<p><pre>
+-- mar. 4 nov. 2014
+ * Correction de la boîte englobante pour {draw,fill}Triangle().
+
-- mar. 21 oct. 2014
* Les méthodes *sleep() sont `public'.
* Vérification des coordonnées dans drawPoint().