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

Corners of a rounded rectangle are not equally round

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P1: Critical
    • None
    • 4.7.3
    • GUI: Painting

    Description

      STEPS LEADING TO PROBLEM:
      1. QPainterPath path;
      2. path.addRoundedRect(boundingRect(), 12, 12);
      3. painter->fillPath(path, Qt::red);

      EXPECTED OUTCOME:
      Each corner of the rounded rectangle looks exactly the same except for being
      mirrored from each other.

      ACTUAL OUTCOME:
      The rounded corners look different. When the corner radius is 12, the number of
      pixels cut from each corner is as follows:

      Top left: 12 + 8 + 6 + 5 + 4 + 3 + 2 + 2 + 1 + 1 + 1 + 1 = 46
      Top right: 1 + 1 + 1 + 1 + 1 + 2 + 2 + 3 + 4 + 5 + 6 + 8 = 35
      Bottom left: 11 + 7 + 5 + 4 + 3 + 2 + 1 + 1 = 34
      Bottom right: 1 + 1 + 2 + 3 + 4 + 5 + 7 = 23

      This makes the rounded rectangle look non-uniform and some of the corners don't
      even look very rounded any more. If the corner radius is smaller, the problem
      gets much worse.

      Test case and screen shot as an attachment.

      Attachments

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

        Activity

          People

            rodal Samuel Rødal
            jupakari Juuso Pakarinen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes