Event commentaire

This commit is contained in:
2025-10-08 15:15:04 +02:00
parent 90874a3296
commit 62f6f94be7
8 changed files with 25 additions and 32 deletions

View File

@@ -47,8 +47,7 @@ public class Dessin extends JPanel {
graphics2D.drawLine(postXCoordinate, marginPixels, postXCoordinate + beamLength, marginPixels);
// Renfort diagonal
graphics2D.drawLine(postXCoordinate, marginPixels + height / 10,
postXCoordinate + width / 12, marginPixels);
graphics2D.drawLine(postXCoordinate, marginPixels + height / 10, postXCoordinate + width / 12, marginPixels);
// Corde
int ropeXCoordinate = postXCoordinate + beamLength;
@@ -60,8 +59,7 @@ public class Dessin extends JPanel {
int headRadiusPixels = Math.min(width, height) / 16;
int headCenterX = ropeXCoordinate;
int headCenterY = ropeBottomYCoordinate + headRadiusPixels;
graphics2D.drawOval(headCenterX - headRadiusPixels, headCenterY - headRadiusPixels,
headRadiusPixels * 2, headRadiusPixels * 2);
graphics2D.drawOval(headCenterX - headRadiusPixels, headCenterY - headRadiusPixels, headRadiusPixels * 2, headRadiusPixels * 2);
// Corps
int bodyTopYCoordinate = headCenterY + headRadiusPixels;
@@ -71,17 +69,13 @@ public class Dessin extends JPanel {
// Bras
int armSpanPixels = width / 10;
int shouldersYCoordinate = bodyTopYCoordinate + height / 24;
graphics2D.drawLine(headCenterX, shouldersYCoordinate,
headCenterX - armSpanPixels, shouldersYCoordinate + height / 20);
graphics2D.drawLine(headCenterX, shouldersYCoordinate,
headCenterX + armSpanPixels, shouldersYCoordinate + height / 20);
graphics2D.drawLine(headCenterX, shouldersYCoordinate, headCenterX - armSpanPixels, shouldersYCoordinate + height / 20);
graphics2D.drawLine(headCenterX, shouldersYCoordinate, headCenterX + armSpanPixels, shouldersYCoordinate + height / 20);
// Jambes
int legSpanPixels = width / 12;
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate,
headCenterX - legSpanPixels, bodyBottomYCoordinate + height / 8);
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate,
headCenterX + legSpanPixels, bodyBottomYCoordinate + height / 8);
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate, headCenterX - legSpanPixels, bodyBottomYCoordinate + height / 8);
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate, headCenterX + legSpanPixels, bodyBottomYCoordinate + height / 8);
graphics2D.dispose();
}