Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8240507

4 gaps appear in webview using rounded corners under windows10, 2x zoom

    Details

    • Subcomponent:
      web
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
      none/windows10/openjdk14

      A DESCRIPTION OF THE PROBLEM :
      电脑是2k屏幕,windows10为了使图标、字体适合浏览,提供了缩放功能,具体位置在:显示->缩放与布局->更改文本、应用等项目的大小,我选择的是200%(推荐),在使用javafx的webview浏览网页时,网页中带圆角的按钮四个角会出现空隙,如果将缩放改为100%时则不会,但是100%看起来会特别小!

      REGRESSION : Last worked in version 14

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      将windows10缩放设置为200%:显示->缩放与布局->更改文本、应用等项目的大小=200%
      运行javafx webview浏览带圆角的按钮将会重现此问题。
      (我的屏幕是2k,不确定在其他分辨率是否会重现此问题)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      按钮四角没有空隙
      ACTUAL -
      按钮四角有空隙

      ---------- BEGIN SOURCE ----------
      package javafx.test;

      import javafx.application.Platform;
      import javafx.scene.Scene;
      import javafx.scene.layout.StackPane;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      import java.io.IOException;

      public class Application extends javafx.application.Application {

          WebView webView = new WebView();
          WebEngine engine = webView.getEngine();

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws IOException {
              engine.loadContent("<body style='background: #000000'>" +
                      "<div style='background: #ff0000; border: 1px solid #f5a623; border-radius: 4px; height: 30px; width: 60px;'></div>" +
                      "</body>");
              StackPane root = new StackPane();
              root.getChildren().add(webView);
              Scene scene = new Scene(root);
              stage.setTitle("test");
              stage.setScene(scene);
              stage.setOnCloseRequest(windowEvent -> {
                  Platform.exit();
              });
              stage.show();
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      1、将windows10缩放改为100%,但是这样做字体、图标会变的非常小。
      2、在1的情况下更换分辨率低的显示器或者调低分辨率


      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              ghb Guru Hb
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: