Skip to content

Commit 7cc1cce

Browse files
committed
PaintImmediately fix (part 1)
1 parent a069530 commit 7cc1cce

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,15 @@ public Graphics getGraphics() {
242242
if (width == 0 || height == 0 || !isVisible())
243243
return null;
244244
Graphics g;
245-
if (秘frameViewer != null) {
245+
// this was 秘frameViewer != null, but that
246+
// fails for paintImmediately, because all components
247+
// have a reference to FrameViewer now, and so the
248+
// offset was not being applied. The special case for
249+
// ContentPane adds its insets. parent == null is a
250+
// proxy for Applet or Window since only they can be
251+
// here and not have a parent.
252+
if (parent == null || 秘isContentPane) {
253+
// this next call adds the necessary transform.
246254
g = 秘frameViewer.getGraphics().create();
247255
if (秘isContentPane) {
248256
if (秘tempInsets == null)

0 commit comments

Comments
 (0)