Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30918

Canvas: shadowBlur is either missing or rough for small values

    XMLWordPrintable

Details

    • 030ebca1f74dfb6f858bc4e2c594bd2075ca189c e1a8762e9c39133cb3d1d9c2cdf51003f75d6c05

    Description

      With a value of < 2.0, the shadowBlur property has no effect.
      With a value >= 2.0 and < 4.0, the blur is not really a blur:

      With a value >= 4.0 and < 6.0, the blur is still quite rough:

      import QtQuick 2.0
      
      Item {
          id: root
          width: 300
          height: 300
      
          function degToRad(degrees) {
              return degrees * (Math.PI / 180);
          }
      
          Canvas {
              id: contentCanvas
              width: parent.width
              height: parent.height
      
              onPaint: {
                  var ctx = getContext("2d");
                  ctx.lineWidth = 8;
                  ctx.strokeStyle = "blue";
                  ctx.shadowBlur = 1.9;
      //            ctx.shadowBlur = 3.9;
      //            ctx.shadowBlur = 5.9;
                  ctx.shadowColor = "blue";
      
                  ctx.beginPath();
                  ctx.arc(width / 2, height / 2, 50, degToRad(0), degToRad(360), false);
                  ctx.stroke();
              }
          }
      }
      

      It should look like it does with the same values here: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_canvas_shadowblur

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              rodal Samuel Rødal
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes