Skip to content

Commit 1d95ae1

Browse files
committed
early fail for repaint with width<=0 and height<=0
1 parent 1539824 commit 1d95ae1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ public interface A2SWrappedComponent {
158158

159159
@Override
160160
public void repaint() {
161+
if (width <= 0 || height <= 0)
162+
return;
161163
if (秘isAWT()) {
162164
秘repaintCmp(0, 0, 0, width, height);
163165
} else {
@@ -701,6 +703,8 @@ protected boolean canPaint() {
701703
* javax.swing, primarily)
702704
*/
703705
public void 秘repaint() {
706+
if (width <= 0 || height <= 0)
707+
return;
704708
if (秘isAWT()) {
705709
// this is an internal Swing repaint call - do not use update(Graphics)
706710
秘repaintAsUpdate = false;

0 commit comments

Comments
 (0)