mirror of
https://github.com/Akomry/makeyourownapp-jam.git
synced 2025-12-06 08:43:54 +00:00
fix(Stroke): possibilité d'augmenter la taille du brush sans corruption
This commit is contained in:
parent
70e583a380
commit
c47b49a616
1 changed files with 13 additions and 11 deletions
|
|
@ -2,6 +2,8 @@ package fr.emiko.graphicsElement;
|
||||||
|
|
||||||
import javafx.scene.canvas.GraphicsContext;
|
import javafx.scene.canvas.GraphicsContext;
|
||||||
import javafx.scene.shape.Path;
|
import javafx.scene.shape.Path;
|
||||||
|
import javafx.scene.shape.StrokeLineCap;
|
||||||
|
import javafx.scene.shape.StrokeLineJoin;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
|
@ -19,17 +21,17 @@ public class Stroke {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void draw (GraphicsContext g) {
|
public void draw (GraphicsContext g) {
|
||||||
// g.setStroke(javafx.scene.paint.Color.BLACK);
|
g.setStroke(javafx.scene.paint.Color.BLACK);
|
||||||
// g.setLineWidth(1);
|
g.setLineCap(StrokeLineCap.ROUND);
|
||||||
// g.beginPath();
|
g.setMiterLimit(1);
|
||||||
// g.moveTo(fromX, fromY);
|
g.setLineWidth(10);
|
||||||
// g.lineTo(toX, toY);
|
g.setLineJoin(StrokeLineJoin.ROUND);
|
||||||
// g.closePath();
|
g.beginPath();
|
||||||
// g.stroke();
|
g.moveTo(fromX, fromY);
|
||||||
// g.fill();
|
g.lineTo(toX, toY);
|
||||||
|
g.closePath();
|
||||||
g.setFill(javafx.scene.paint.Color.BLACK);
|
g.stroke();
|
||||||
g.fillOval(toX-5, toY-5, 10, 10);
|
g.fill();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue