Project

General

Profile

9571a.diff

Hynek Cihlar, 01/30/2025 09:32 AM

Download (1.39 KB)

View differences:

new/src/com/goldencode/p2j/ui/client/gui/driver/swing/SwingEmulatedWindow.java 2025-01-30 14:27:16 +0000
1742 1742
               GraphicsConfiguration config = device.getDefaultConfiguration();
1743 1743
               Rectangle bounds = config.getBounds();
1744 1744

  
1745
               // TODO: this does not correctly find the intersection because the child window position
1746
               // is x=0,y=0 which is incorrect.
1747 1745
               Rectangle intersection = windowBounds.intersection(bounds);
1748
               int area = intersection.width * intersection.height;
1749
               if (area > maxArea)
1746
               // 0 or negative width or height indicate no intersection
1747
               if (intersection.width > 0 && intersection.height > 0)
1750 1748
               {
1751
                  maxArea = area;
1752
                  targetConfig = config;
1753
                  targetBounds = bounds;
1749
                  int area = intersection.width * intersection.height;
1750
                  if (area > maxArea)
1751
                  {
1752
                     maxArea = area;
1753
                     targetConfig = config;
1754
                     targetBounds = bounds;
1755
                  }
1754 1756
               }
1755 1757
            }
1756 1758
         }