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.shape.Path;
|
||||
import javafx.scene.shape.StrokeLineCap;
|
||||
import javafx.scene.shape.StrokeLineJoin;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
|
|
@ -19,17 +21,17 @@ public class Stroke {
|
|||
}
|
||||
|
||||
public void draw (GraphicsContext g) {
|
||||
// g.setStroke(javafx.scene.paint.Color.BLACK);
|
||||
// g.setLineWidth(1);
|
||||
// g.beginPath();
|
||||
// g.moveTo(fromX, fromY);
|
||||
// g.lineTo(toX, toY);
|
||||
// g.closePath();
|
||||
// g.stroke();
|
||||
// g.fill();
|
||||
|
||||
g.setFill(javafx.scene.paint.Color.BLACK);
|
||||
g.fillOval(toX-5, toY-5, 10, 10);
|
||||
g.setStroke(javafx.scene.paint.Color.BLACK);
|
||||
g.setLineCap(StrokeLineCap.ROUND);
|
||||
g.setMiterLimit(1);
|
||||
g.setLineWidth(10);
|
||||
g.setLineJoin(StrokeLineJoin.ROUND);
|
||||
g.beginPath();
|
||||
g.moveTo(fromX, fromY);
|
||||
g.lineTo(toX, toY);
|
||||
g.closePath();
|
||||
g.stroke();
|
||||
g.fill();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue