Skip to content

Commit

Permalink
Modification du calcul dynamique de l'épaisseur d'un pont
Browse files Browse the repository at this point in the history
  • Loading branch information
tetelie committed Mar 26, 2024
1 parent 165e9e3 commit ed4acdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/fr/hashimiste/impl/gui/builder/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public static void main(String[] args) {
private void updateLayout() {
gridPanel.setLayout(new GridLayout((int) grille.getDimension().getHeight(), (int) grille.getDimension().getWidth()));
gridPanel.removeAll();
for (int x = 0; x < grille.getDimension().getHeight(); x++) {
for (int y = 0; y < grille.getDimension().getWidth(); y++) {
for (int x = 0; x < grille.getDimension().getWidth(); x++) {
for (int y = 0; y < grille.getDimension().getHeight(); y++) {
Ile ile = grille.getIle(x, y);
if (ile != null) {
gridPanel.add(new Cell(ile, grille));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ protected void paintComponent(Graphics g) {
int zeroY = (int) ((getSize().height / 2d) - ((getGrille().getDimension().height * factor) / 2));
float cell_size = (this.getWidth() - zeroX - zeroX) / getGrille().getDimension().width;
Graphics2D g2 = (Graphics2D) g;
float line_thickness = cell_size/10;
g2.setStroke(new BasicStroke(cell_size/10));

float lineThickness = cell_size / 12; // Ajustez le dénominateur selon vos besoins
g2.setStroke(new BasicStroke(lineThickness));
cell_size=(float)factor;

// Espacement entre les deux lignes d'un pont double
int bridgeSpacing = 4;
int bridgeSpacing = (int) (cell_size/12);

// Dessiner les ponts potentiels
for (Bridge bridge : potentialsBridges) {
Expand Down

0 comments on commit ed4acdd

Please sign in to comment.