# HG changeset patch # User Tatsuki IHA # Date 1453192906 -32400 # Node ID cafbff8d5b0913736bed302556b18edaef2503a2 # Parent 0ad52aac3bc307bb33a14f389b4ffa22480879f0 Fix invalid x y Display position diff -r 0ad52aac3bc3 -r cafbff8d5b09 .idea/workspace.xml --- a/.idea/workspace.xml Mon Jan 18 17:37:58 2016 +0900 +++ b/.idea/workspace.xml Tue Jan 19 17:41:46 2016 +0900 @@ -3,9 +3,6 @@ - - - @@ -41,7 +38,7 @@ - + @@ -54,18 +51,6 @@ - - - - - - - - - - - - @@ -80,35 +65,86 @@ - + - - + + - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - + + + + + + + + + @@ -118,7 +154,7 @@ - + @@ -134,32 +170,48 @@ - - + + + + + + - - + + - - - - - - + + + + + + + + + + + + - - + + + + + + + + + + + + - - - - - - + + @@ -169,7 +221,7 @@ - + @@ -180,7 +232,19 @@ - + + + + + + + + + + + + + @@ -189,9 +253,8 @@ - + - @@ -202,20 +265,21 @@ - + - + - - + + + @@ -227,74 +291,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -621,8 +622,8 @@ - @@ -651,6 +652,7 @@ + @@ -897,9 +899,8 @@ - + - @@ -1334,31 +1335,31 @@ - + - + - + - - + - + + @@ -1560,12 +1561,6 @@ - - - - - - - - - - - - - - @@ -1857,17 +1826,6 @@ - - - - - - - - - - - @@ -1893,14 +1851,6 @@ - - - - - - - - @@ -1908,22 +1858,6 @@ - - - - - - - - - - - - - - - - @@ -1932,22 +1866,6 @@ - - - - - - - - - - - - - - - - @@ -1972,14 +1890,6 @@ - - - - - - - - @@ -2004,31 +1914,10 @@ - - - - - - - - - - - - - - - - - - - - - @@ -2036,7 +1925,6 @@ - @@ -2044,28 +1932,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -2081,14 +1947,6 @@ - - - - - - - - @@ -2097,14 +1955,6 @@ - - - - - - - - @@ -2117,7 +1967,6 @@ - @@ -2129,25 +1978,6 @@ - - - - - - - - - - - - - - - - - - - @@ -2156,30 +1986,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + - + + + + + + + + + - - + + + + + + + + + + - - - + + - + + + + + + + + + - + + + + + + + + + + + + + @@ -2188,42 +2095,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + diff -r 0ad52aac3bc3 -r cafbff8d5b09 src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java --- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jan 18 17:37:58 2016 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Tue Jan 19 17:41:46 2016 +0900 @@ -923,19 +923,27 @@ int y = (int) (rectangles.get(shareScreenNumber).getY()); // Fix invalid x, y position. - if(x == 0 && y == 0) { - for (Rectangle rectangle : rectangles) { + if (x == 0 && y == 0) { + for (int i = 0; i < rectangles.size(); i++) { + Rectangle rectangle = rectangles.get(i); + int scale = retinaScale(i); if (rectangle.getX() < 0) { - x = Math.abs((int) rectangle.getX()); + x = Math.abs((int) rectangle.getX()) * scale; } if (rectangle.getY() < 0) { - y = Math.abs((int) rectangle.getY()); + y = Math.abs((int) rectangle.getY()) * scale; } } } else { - x = x < 0 ? 0 : x; - y = y < 0 ? 0 : y; + for (int i = 0; i < rectangles.size(); i++) { + if(i != shareScreenNumber) { + x = x * retinaScale(i); + y = y * retinaScale(i); + } + } } + x = x < 0 ? 0 : x; + y = y < 0 ? 0 : y; int scale = retinaScale(shareScreenNumber);