Skip to content

Commit 599b507

Browse files
hansonrhansonr
authored andcommitted
logic error in invalidate(); isContentPane issue
1 parent 55e5378 commit 599b507

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sources/net.sf.j2s.java.core/src/java/awt/Component.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ protected void invalidateComp() {
26792679
if (!isMaximumSizeSet()) {
26802680
maxSize = null;
26812681
}
2682-
if (parent != null && !_j2sInvalidateOnAdd) {
2682+
if (parent != null && _j2sInvalidateOnAdd) {
26832683
parent.invalidateIfValid();
26842684
}
26852685
// }

sources/net.sf.j2s.java.core/src/javax/swing/JComponent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,11 @@ protected void paintChildren(Graphics g) {
687687
// and probably not do this.
688688
// SwingJS TODO -- allow JSpecView-like layer for writing over buttons
689689
if (jc != null && jc.isVisible()) {
690-
jc.getBounds(tmpRect);
690+
jc.getBounds(tmpRect);
691+
boolean isContentPane = jc.getRootPane().getContentPane() == jc;
691692
Rectangle vr = (jc instanceof JTable ? jc.getVisibleRect() : tmpRect);
692693
JSGraphics2D jsg = (JSGraphics2D) (Object) sg.create(tmpRect.x,
693-
(jc.isContentPane ? 0 : tmpRect.y), vr.width, vr.height);
694+
(isContentPane ? 0 : tmpRect.y), vr.width, vr.height);
694695
jsg.setColor(jc.getForeground());
695696
jsg.setFont(jc.getFont());
696697
boolean shouldSetFlagBack = false;

0 commit comments

Comments
 (0)