mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
back compatibility
This commit is contained in:
+4
-4
@@ -51,7 +51,7 @@ public class Label extends AbstractComponent<Void> {
|
|||||||
|
|
||||||
int x = point.x;
|
int x = point.x;
|
||||||
int y = point.y;
|
int y = point.y;
|
||||||
switch (verticalAlignment) {
|
switch (getVerticalAlignment()) {
|
||||||
case CENTER:
|
case CENTER:
|
||||||
y = point.y - textHeight / 2 + fontMetrics.getAscent();
|
y = point.y - textHeight / 2 + fontMetrics.getAscent();
|
||||||
break;
|
break;
|
||||||
@@ -63,9 +63,9 @@ public class Label extends AbstractComponent<Void> {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException("Unexpected alignment: "
|
throw new RuntimeException("Unexpected alignment: "
|
||||||
+ verticalAlignment);
|
+ getVerticalAlignment());
|
||||||
}
|
}
|
||||||
switch (horizontalAlignment) {
|
switch (getHorizontalAlignment()) {
|
||||||
case CENTER:
|
case CENTER:
|
||||||
x = point.x - textWidth / 2;
|
x = point.x - textWidth / 2;
|
||||||
break;
|
break;
|
||||||
@@ -77,7 +77,7 @@ public class Label extends AbstractComponent<Void> {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException("Unexpected alignment: "
|
throw new RuntimeException("Unexpected alignment: "
|
||||||
+ horizontalAlignment);
|
+ getHorizontalAlignment());
|
||||||
}
|
}
|
||||||
|
|
||||||
g2d.drawString(text, x, y);
|
g2d.drawString(text, x, y);
|
||||||
|
|||||||
Reference in New Issue
Block a user