-
Sub-task
-
Resolution: Fixed
-
P3
-
8
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);
}
}
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);
}
}