Skip to content

Commit d8b2ba7

Browse files
hansonrhansonr
authored andcommitted
vertical alignment simplification
1 parent 0a784d2 commit d8b2ba7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,8 @@ protected void setAlignments(AbstractButton b, boolean justGetPreferred) {
25742574

25752575
DOMNode.setStyles(centeringNode, "position", "absolute", "top", null, "left", null, "transform", null, "width", wCtr + "px", "height", hCtr + "px");
25762576

2577+
// horizontal
2578+
25772579
isFullyCentered = false;
25782580
if (alignHCenter && alignVCenter && wIcon == 0 || wText == 0 && margins.left == margins.right
25792581
&& margins.top == margins.bottom && insets.left == insets.right && insets.top == insets.bottom)
@@ -2646,10 +2648,12 @@ protected void setAlignments(AbstractButton b, boolean justGetPreferred) {
26462648
}
26472649
}
26482650

2651+
// vertical
2652+
26492653
h = c.getHeight();
26502654

26512655
if (h == 0) {
2652-
h = 16;
2656+
h = 16; // fallback -- actually, this is a real problem.
26532657
}
26542658

26552659
if (menuAnchorNode == null) {
@@ -2698,7 +2702,7 @@ protected void setAlignments(AbstractButton b, boolean justGetPreferred) {
26982702
"translateY(-" + itop + "%)" + (iscale == null ? "" : iscale));
26992703
} else {
27002704
DOMNode.setStyles(menuAnchorNode, "height", h + "px");
2701-
addCSS(cssTxt, "top", "50%", "transform", "translateY(-50%)");
2705+
//addCSS(cssTxt, "top", "50%", "transform", "translateY(-50%)");
27022706
addCSS(cssIcon, "top", "50%", "transform", "translateY(-65%) scale(0.6,0.6)");
27032707
}
27042708

0 commit comments

Comments
 (0)