Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 459:9f5cd8ca0ebc
Without retina scale to calcoffset
author | one |
---|---|
date | Thu, 23 Jun 2016 19:36:31 +0900 |
parents | 4ea47640942a |
children | c6058c4e2a79 |
files | src/viewer_swing/java/com/glavsoft/viewer/Viewer.java |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Thu Jun 23 18:57:12 2016 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Thu Jun 23 19:36:31 2016 +0900 @@ -504,6 +504,7 @@ fbRectangles.add(new FbRectangle(rect.x + offset.x, rect.y + offset.y, rect.width, rect.height, screenNumber, retinaScale(screenNumber))); screenNumber++; } + fbRectangles.sort(new Comparator<FbRectangle>() { @Override public int compare(FbRectangle t0, FbRectangle t1) { @@ -527,6 +528,13 @@ fbRectanglesPrev = fbRect; } + fbRectangles.sort(new Comparator<FbRectangle>() { + @Override + public int compare(FbRectangle t0, FbRectangle t1) { + return t0.getY() < t1.getY() ? -1 : t0.getY() == t1.getY() ? 0 : 1; + } + }); + int retinaOffsetY = 0; fbRectanglesPrev = fbRectangles.get(0); for (int i = 1; i < fbRectangles.size(); i++) { @@ -550,14 +558,9 @@ // compute offset to make them positive int offsetx = 0; int offsety = 0; - int screenNumber = 0; for (Rectangle rect : rectangles) { - int scale = retinaScale(screenNumber); - int x = rect.x == -rect.width ? rect.x * scale : rect.x; - int y = rect.y == -rect.height ? rect.y * scale : rect.y; - if (x < offsetx) offsetx = x; - if (y < offsety) offsety = y; - screenNumber++; + if (rect.x < offsetx) offsetx = rect.x; + if (rect.y < offsety) offsety = rect.y; } return new Point(-offsetx,-offsety); }