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

Clipping region doesn't resize to canvas size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 5.2.0
    • Observed on:
       - Windows 7 64-bit, with ANGLE build
       - Mac OS 10.8.5

    Description

      If you run the following QML and resize the window, you will see that the blue rectangle gets clipped by a region which doesn't correspond to the desired clipping region (indicated by the red outline).

      import QtQuick 2.0
      
      Canvas {
          id: canvas
      
          height: 200
          width: 200
      
          onPaint: {
              var ctx = canvas.getContext('2d')
      
              ctx.clearRect(0, 0, width, height)
      
              ctx.save()
      
              ctx.beginPath();
              ctx.rect(0, 0, width/2, height/2);
              ctx.strokeStyle = "red";
              ctx.stroke();
              ctx.clip();
      
              ctx.fillStyle = "blue"
              ctx.fillRect(0, 0, width, height);
      
              ctx.restore()
          }
      }
      

      This was already described by RickyKeith here: http://qt-project.org/forums/viewthread/37152/

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            che Carsten Henßinger
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes