Skip to content

Commit d043d06

Browse files
hansonrhansonr
authored andcommitted
+2 pixel y offset fudge for labels.
1 parent 636e51b commit d043d06

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,15 +2229,9 @@ protected int getDefaultIconTextGap() {
22292229
protected static Insets zeroInsets = new Insets(0, 0, 0, 0);
22302230

22312231
protected void getJSInsets() {
2232-
String s = /** @j2sNative this.jc.getInsets$.exClazz.__CLASS_NAME__ || */"";
2233-
boolean overwritten = s.indexOf("java") != 0 && s.indexOf("swingjs") != 0;
2234-
if (overwritten) {
2235-
insets = jc.getInsets();
2236-
} else {
2237-
if (insets == null)
2238-
insets = new Insets(0, 0, 0, 0);
2239-
jc.getInsets(insets);
2240-
}
2232+
if (insets == null)
2233+
insets = new Insets(0, 0, 0, 0);
2234+
insets = jc.getInsets(insets);
22412235
}
22422236

22432237
public void setButtonRectangles(boolean isPreferred) {
@@ -2527,7 +2521,8 @@ protected void setAlignments(AbstractButton b, boolean justGetPreferred) {
25272521
itop = 70;
25282522
iscale = "scale(0.6,0.6)";
25292523
}
2530-
yoff = (wIcon == 0 ? "-" + ((jc.getFont().getFontMetrics().getAscent()>>1)+1) + "px" : "-50%");
2524+
// +3 here is a fudge factor for the AWT applets
2525+
yoff = (wIcon == 0 ? "-" + ((jc.getFont().getFontMetrics().getAscent()>>1)+3) + "px" : "-50%");
25312526
break;
25322527
case SwingConstants.BOTTOM:
25332528
top = itop = 100;

0 commit comments

Comments
 (0)