Mercurial > hg > Members > riono > TreeVNC_ja_comment
diff src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java @ 452:e94489c9a0bb
fitScreen correctly worked on multi screen
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 Jun 2016 11:24:04 +0900 |
parents | 65ffb64cfb51 |
children | d0ca1be5c47c |
line wrap: on
line diff
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jun 20 12:04:13 2016 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Tue Jun 21 11:24:04 2016 +0900 @@ -998,17 +998,17 @@ int thatRetinaScale = presenter.getRetinaScale(); final int thatScreenWidth = viewer.getRfb().getSingleWidth(); final int thatScreenHeight = viewer.getRfb().getSingleHeight(); - showScreenInfo("that", 0, thatScreenX, thatScreenY, thatScreenWidth, thatScreenHeight, thatRetinaScale); - System.out.println("that FB x:" + presenter.getFrameSizeWidth() + " y:" + presenter.getFrameSizeHeight()); + // showScreenInfo("that", 0, thatScreenX, thatScreenY, thatScreenWidth, thatScreenHeight, thatRetinaScale); + // System.out.println("that FB x:" + viewer.getRfb().getContext().getFbWidth() + " y:" + viewer.getRfb().getContext().getFbHeight()); frame.setSize(thisScreenWidth, thisScreenHeight); double scale = uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, thatScreenWidth, thatScreenHeight); // final Rectangle visible = new Rectangle((int)(thatScreenX*scale),(int)(thatScreenY*scale),(int)(thatScreenWidth*scale)-1,(int)(thatScreenHeight*scale)-1); - showScreenInfo("this", thisScreenNumber, 0, 0,thisScreenWidth, thisScreenHeight, thisRetinaScale); - System.out.println("this FB x:" + viewer.getConnectionPresenter().getFrameSizeWidth() + " y:" + viewer.getConnectionPresenter().getFrameSizeHeight()); - System.out.println("thisScrollScale: " + scale + " ymax:"+scroller.getVerticalScrollBar().getMaximum()); + // showScreenInfo("this", thisScreenNumber, 0, 0,thisScreenWidth, thisScreenHeight, thisRetinaScale); final int scrollx = (int)(thatScreenX * scale); - final int scrolly = (int)((presenter.getFrameSizeHeight()-thatScreenY) * scale) ; + final int scrolly = (int)(thatScreenY * scale); + // System.out.println("thisScrollScale: " + scale + " xmax:"+scroller.getHorizontalScrollBar().getMaximum() + " scrollx:"+scrollx); + // System.out.println("thisScrollScale: " + scale + " ymax:"+scroller.getVerticalScrollBar().getMaximum() + " scrolly:"+scrolly); SwingUtilities.invokeLater(new Runnable() { public void run() { scroller.getHorizontalScrollBar().setValue(scrollx);