Skip to content

Commit 35b81b1

Browse files
hansonrhansonr
authored andcommitted
fixing g.fill3dRect() and width of centered tag can be too small
1 parent 51b416d commit 35b81b1

File tree

3 files changed

+968
-2
lines changed

3 files changed

+968
-2
lines changed

sources/net.sf.j2s.java.core/src/swingjs/JSGraphics2D.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import swingjs.api.js.HTML5Canvas;
3636
import swingjs.api.js.HTML5CanvasContext2D;
3737

38+
// BH 9/18/2018 fill3DRect fix
3839
// BH 6/2018 adds g.copyArea(x,y,width,height,dx,dy)
3940

4041
/**
@@ -261,7 +262,7 @@ public void fill3DRect(int x, int y, int width, int height, boolean raised) {
261262
do3DRect(x, y, width, height, raised, true);
262263
}
263264

264-
private void do3DRect(int x, int y, int width2, int height2, boolean raised, boolean isFill) {
265+
private void do3DRect(int x, int y, int width, int height, boolean raised, boolean isFill) {
265266
if (width <= 0 || height <= 0)
266267
return;
267268
Paint p = getPaint();

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,7 @@ protected void setHorizontalButtonAlignments(JComponent b, int pos, int align) {
15611561

15621562
// DOMNode.setAttr(textNode, "innerHTML", pos);
15631563

1564+
15641565
int wIcon = Math.max(0, setHTMLSize1(iconNode, false, false).width - 1);
15651566
int wText = setHTMLSize1(textNode, false, false).width - 1;
15661567

@@ -1644,8 +1645,12 @@ protected void setHorizontalButtonAlignments(JComponent b, int pos, int align) {
16441645

16451646
DOMNode.setPositionAbsolute(iconNode);
16461647
DOMNode.setPositionAbsolute(textNode);
1647-
if (buttonNode != null)
1648+
if (buttonNode != null) {
16481649
DOMNode.setPositionAbsolute(buttonNode);
1650+
} else if (centeringNode != null) {
1651+
// See test/Puzzle.java
1652+
DOMNode.setStyles(centeringNode, "width", "100%");
1653+
}
16491654

16501655
}
16511656

0 commit comments

Comments
 (0)