Neuer Konstruktor, der ein Font-Objekt annimmt.

This commit is contained in:
ngb
2022-01-06 09:32:49 +01:00
parent 83ab156f71
commit 7635e29a98

View File

@@ -15,9 +15,14 @@ public class Text extends Shape {
protected int width = 0, height = 0, ascent = 0;
public Text( double x, double y, String text ) {
this(x, y, text, new Font(Font.SANS_SERIF, Font.PLAIN, STD_FONTSIZE));
}
public Text( double x, double y, String text, Font font ) {
super(x, y);
font = new Font(Font.SANS_SERIF, Font.PLAIN, STD_FONTSIZE);
this.font = font;
setText(text);
anchor = Options.Direction.CENTER;
}
public Text( Text text ) {