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

Uneven fill of long, thin rectangles in CurveRenderer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.0
    • Quick: Shapes
    • None
    • All

    Description

      As found when experimenting with underlines on text, long thin rectangles rendered with the fill nodes are a little bit off. It can be seen with the following example (with no additional high-dpi scaling) where parts of the rectangle is black, but other parts are lighter. Changing the fractional position and the fractional part of the size of the rectangle gives different areas that are gray.

      import QtQuick
      import QtQuick.Window
      import QtQuick.Shapes
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Shape {
              anchors.left: parent.left
              anchors.top: parent.top
              preferredRendererType: Shape.CurveRenderer
              ShapePath {
                  id: shapePath
                  fillColor: "black"
                  strokeColor: "transparent"
      
                  property real xpos: 211.453
                  property real ypos: 14.75
                  property real w: 219.016
                  property real h: 1.03125
      
                  PathMove {
                      x: shapePath.xpos; y: shapePath.ypos
                  }
      
                  PathLine {
                      x: shapePath.xpos + shapePath.w; y: shapePath.ypos
                  }
      
                  PathLine {
                      x: shapePath.xpos + shapePath.w; y: shapePath.ypos + shapePath.h
                  }
      
                  PathLine {
                      x: shapePath.xpos; y: shapePath.ypos + shapePath.h
                  }
      
                  PathLine {
                      x: shapePath.xpos; y: shapePath.ypos
                  }
              }
          }
      }
      

      Zoomed in view of the line:

      Attachments

        1. image-2023-11-09-13-17-21-675.png
          3 kB
          Eskil Abrahamsen Blomfeldt
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes