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

Innershadow and Dropshadow compete by the same parameter

XMLWordPrintable

    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.8.0_121"
      Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      macOS Sierra 10.12.2

      A DESCRIPTION OF THE PROBLEM :
      Innershadow and Dropshadow compete by the same parameter.

      When the same parameter is specified in innershadow and dropshadow in CSS style,
      The actual effect is overwritten on the one hand.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Start the test application
      2) Confirm that labels and actual effects are different

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The label matches the actual effect.
      ACTUAL -
      Label and actual effect do not match.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.Separator;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class ShadowEffectTest extends Application{

      @Override
      public void start(Stage primaryStage) throws Exception {

      StackPane r1 = new StackPane(new Label("drop shadow: NG"));
      StackPane r2 = new StackPane(new Label("inner shadow: NG"));
      StackPane r3 = new StackPane(new Label("inner shadow: NG"));
      StackPane r4 = new StackPane(new Label("drop shadow: NG"));
      StackPane r5 = new StackPane(new Label("drop shadow: OK"));
      StackPane r6 = new StackPane(new Label("inner shadow: OK"));

      VBox root = new VBox(r1, r2, new Separator(), r3, r4, new Separator(), r5, r6);
      root.setSpacing(16);

      r1.setStyle("-fx-border-width:16px; -fx-border-color:red; -fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.5), 16, 0.0, 0, 8)");
      r2.setStyle("-fx-border-width:16px; -fx-border-color:red; -fx-effect: innershadow(gaussian, rgba(0, 0, 0, 0.5), 16, 0.0, 0, 8)");
      r3.setStyle("-fx-border-width:16px; -fx-border-color:red; -fx-effect: innershadow(gaussian, rgba(0, 0, 0, 0.5), 16, 0.0, 0, 9)");
      r4.setStyle("-fx-border-width:16px; -fx-border-color:red; -fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.5), 16, 0.0, 0, 9)");
      r5.setStyle("-fx-border-width:16px; -fx-border-color:red; -fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.5), 16, 0.0, 0, 10)");
      r6.setStyle("-fx-border-width:16px; -fx-border-color:red; -fx-effect: innershadow(gaussian, rgba(0, 0, 0, 0.5), 16, 0.0, 0, 11)");
      root.setStyle("-fx-padding:1em; -fx-font-size:32pt");

      Scene scene = new Scene(root);
      primaryStage.setScene(scene);
      primaryStage.show();
      }

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

      ---------- END SOURCE ----------

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: