comparison src/viewer_swing/java/com/glavsoft/viewer/Viewer.java @ 630:7071b01621c2 default tip

Determine ipv4 or ipv6 and fix scond display
author riono <e165729@ie.u-ryukyu.ac.jp>
date Tue, 28 Apr 2020 19:49:38 +0900
parents c67f0f6eae90
children
comparison
equal deleted inserted replaced
629:710c26fd3ebe 630:7071b01621c2
552 552
553 int retinaOffsetX = 0; 553 int retinaOffsetX = 0;
554 FbRectangle fbRectanglesPrev = fbRectangles.get(0); 554 FbRectangle fbRectanglesPrev = fbRectangles.get(0);
555 for (int i = 1; i < fbRectangles.size(); i++) { 555 for (int i = 1; i < fbRectangles.size(); i++) {
556 FbRectangle fbRect = fbRectangles.get(i); 556 FbRectangle fbRect = fbRectangles.get(i);
557 if (fbRect.getIsRetina()) { 557 if (fbRectanglesPrev.getRetinaScale() != 1) {
558 if (fbRectanglesPrev.x + fbRectanglesPrev.width <= fbRect.x) { 558 if (fbRectanglesPrev.x + fbRectanglesPrev.width <= fbRect.x) {
559 // previous screen is touch with this screen, fix retina scale offset 559 // previous screen is touch with this screen, fix retina scale offset
560 retinaOffsetX += fbRectanglesPrev.getWidth() * (fbRectanglesPrev.retinaScale - 1); 560 retinaOffsetX += fbRectanglesPrev.getWidth() * (fbRectanglesPrev.retinaScale - 1);
561 } 561 }
562 } 562 }
568 568
569 int retinaOffsetY = 0; 569 int retinaOffsetY = 0;
570 fbRectanglesPrev = fbRectangles.get(0); 570 fbRectanglesPrev = fbRectangles.get(0);
571 for (int i = 1; i < fbRectangles.size(); i++) { 571 for (int i = 1; i < fbRectangles.size(); i++) {
572 FbRectangle fbRect = fbRectangles.get(i); 572 FbRectangle fbRect = fbRectangles.get(i);
573 if (fbRect.getIsRetina()) { 573 if (fbRectanglesPrev.getRetinaScale() != 1) {
574 if (fbRectanglesPrev.y + fbRectanglesPrev.height <= fbRect.y) { 574 if (fbRectanglesPrev.y + fbRectanglesPrev.height <= fbRect.y) {
575 // previous screen is touch with this screen, fix retina scale offset 575 // previous screen is touch with this screen, fix retina scale offset
576 retinaOffsetY += fbRectanglesPrev.getHeight() * (fbRectanglesPrev.retinaScale - 1); 576 retinaOffsetY += fbRectanglesPrev.getHeight() * (fbRectanglesPrev.retinaScale - 1);
577 } 577 }
578 } 578 }
607 int scale = 1; 607 int scale = 1;
608 GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); 608 GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
609 final GraphicsDevice[] devices = env.getScreenDevices(); 609 final GraphicsDevice[] devices = env.getScreenDevices();
610 GraphicsConfiguration conf = devices[shareScreenNumber].getDefaultConfiguration(); 610 GraphicsConfiguration conf = devices[shareScreenNumber].getDefaultConfiguration();
611 scale = (int)conf.getDefaultTransform().getScaleX(); 611 scale = (int)conf.getDefaultTransform().getScaleX();
612 System.out.println("scale:" + scale + "\n\n");
612 return scale; 613 return scale;
613 } 614 }
614 615
615 @Override 616 @Override
616 public void setFitScreen() { 617 public void setFitScreen() {