Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8112986 WebView in scenter slot of BorderPane has visual deffects
  3. JDK-8113752

WebView "out of clipping bounds" when set as center of BorderPane + Rotation effect

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Subcomponent:
      web

      Description

      WebView is incorrectly displayed, out of its clipping bounds and with some rendering artifacts when applying a rotation on it.
      In this sample, the WebView is set in the center of a BorderPane.

      Thanks.

      Here is the code:




      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.Slider;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.layout.FlowPane;
      import javafx.scene.paint.Color;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      /**
       *
       */
      public class WebViewTransiton extends Application {

          WebView webView;

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              Application.launch(WebViewTransiton.class, args);
          }

          @Override
          public void start(Stage primaryStage) {

              primaryStage.setTitle("Effects on WebView Pane");
              BorderPane root = new BorderPane();
              Scene scene = new Scene(root, 800, 650, Color.WHITE);
              scene.setFill(Color.AQUA);

              WebEngine engine = new WebEngine();
              engine.load("http://javafx.com");
              webView = new WebView(engine);

              FlowPane flow = new FlowPane();
              flow.setPadding(new Insets(10, 10, 10, 10));

              // Rotation
              Slider sliderRotation = new Slider(0, 359, 0);
              sliderRotation.setValue(0);
              sliderRotation.setBlockIncrement(1);
              sliderRotation.setMajorTickUnit(1);
              sliderRotation.setMinorTickCount(1);
              sliderRotation.setSnapToTicks(true);
              webView.rotateProperty().bind(sliderRotation.valueProperty());

              flow.getChildren().add(new Label("Rotation:"));
              flow.getChildren().add(sliderRotation);


              // Root
              root.setCenter(webView);
              root.setBottom(flow);

              primaryStage.setScene(scene);
              primaryStage.setVisible(true);
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              uta Alexey Utkin (Inactive)
              Reporter:
              anouardjfx arnaud nouard (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: