Ignore:
Timestamp:
2012-03-31T16:55:32+02:00 (12 years ago)
Author:
stoecker
Message:

fix multiscreen handling for unseparated virtual screens

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java

    r5015 r5142  
    182182                return new WindowGeometry(new Point(x,y), new Dimension(w,h));
    183183            } else {
    184                 System.out.println(tr("Ignoring malformed geometry: {0}", arg));
     184                Main.warn(tr("Ignoring malformed geometry: {0}", arg));
    185185            }
    186186        }
    187187        WindowGeometry def;
    188         if(maximize)
     188        if(maximize) {
    189189            def = new WindowGeometry(screenDimension);
    190         else
    191             def = new WindowGeometry(screenDimension.getLocation(), new Dimension(1000, 740));
     190        } else {
     191            Point p = screenDimension.getLocation();
     192            p.x += (screenDimension.width-1000)/2;
     193            p.y += (screenDimension.height-740)/2;
     194            def = new WindowGeometry(p, new Dimension(1000, 740));
     195        }
    192196        return new WindowGeometry(preferenceKey, def);
    193197    }
     
    315319            for (int i = 0; i < gc.length; i++) {
    316320                Rectangle b = gc[i].getBounds();
    317                 Rectangle is = b.intersection(g);
    318                 int s = is.width*is.height;
    319                 if(bounds == null || intersect < s) {
    320                     intersect = s;
    321                     bounds = b;
     321                if(b.width/b.height >= 3) /* multiscreen with wrong definition */
     322                {
     323                    b.width /= 2;
     324                    Rectangle is = b.intersection(g);
     325                    int s = is.width*is.height;
     326                    if(bounds == null || intersect < s) {
     327                        intersect = s;
     328                        bounds = b;
     329                    }
     330                    b = new Rectangle(b);
     331                    b.x += b.width;
     332                    is = b.intersection(g);
     333                    s = is.width*is.height;
     334                    if(bounds == null || intersect < s) {
     335                        intersect = s;
     336                        bounds = b;
     337                    }
     338                }
     339                else
     340                {
     341                    Rectangle is = b.intersection(g);
     342                    int s = is.width*is.height;
     343                    if(bounds == null || intersect < s) {
     344                        intersect = s;
     345                        bounds = b;
     346                    }
    322347                }
    323348            }
Note: See TracChangeset for help on using the changeset viewer.