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

JavaFx WebView canvas doesn't support dash within strokeRec

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8, 9
    • Fix Version/s: 9
    • Component/s: javafx
    • Labels:
    • Environment:

      JavaSE8 Windows/Linux + x86/x64.

    • Subcomponent:
      web
    • CPU:
      x86
    • OS:
      windows

      Backports

        Description

        JavaFx Browser usually handles calling Context.setLineDash for any 2D canvas, but it does NOT work for when canvas is using a "strokeRect",
        strokeRect.

        We allow our customers to configure line dash for rectangles so it won't work right when using javafx WebView as the browser, but it works for all other browsers.

        Please, refer to attached PNG image for this problem too.

        This problem can be reproduced with following simple jsfiddle:

        https://jsfiddle.net/8tHDf/3/

        {code}
        var ctx = canvas.getContext('2d');
        ctx.lineWidth = 4;
        ctx.setLineDash([4,4]);
        ctx.strokeStyle = '#f00';
        ctx.strokeRect(10,30,70,70);
        {code}

          Attachments

          1. missingDash.png
            missingDash.png
            39 kB
          2. With-Fix.png
            With-Fix.png
            36 kB
          3. Without-Fix.png
            Without-Fix.png
            36 kB

            Issue Links

              Activity

                People

                Assignee:
                mbilla Murali Billa
                Reporter:
                gucheng Guixin Cheng
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: