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

Custom dashed line offsets drawing incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.7.0
    • 4.6.2
    • GUI: Painting
    • None
    • Windows using Qt 4.6.2 SDK, building in QtCreator

    Description

      I am drawing a custom dashed line between two fixed points. On each update cycle I reduce the dash offset to simulate forward movement of the dashes. If I use the simple pattern in the QPen::setDashOffset() docentation where the stroke is 4 and the gap is 2, iI am finding that:
      1. If the dash offset is equal to the dash pattern (stroke + gap = 6), the program aborts. (UNEXPECTED)
      2. For dash offsets less than the total dash pattern but greater than the stroke length (4 < offset < 6) the line begins stroking at a starting point outside my line coordinates (UNEXPECTED).
      3. For a dash offset equal to my stroke length, the line begins and ends at my coordinates and begins with a full gap.. (OK)
      4. For dash offsets less than my stroke length but .above zero, the line begins and ends at my coordinates and begins with a partial stroke. (OK)
      5. For a dash offset of zero, the line begins and ends at my coordinates and begins with a full stroke. (OK)
      6. For a dash offset between zero and negative stroke length, the line begins and ends at my coordinates and begins with a gap larger than max.. (UNEXPECTED)
      7. For a dash offset between negative stroke length and negative pattern length, the line begins and ends at my coordinates and begins with a stroke larger than max.. (UNEXPECTED)
      The source code is borrowed from QTBUG-9169 and modified. The graphic shows the output.

      Attachments

        1. main.cpp
          1 kB
        2. screenshot-1.jpg
          screenshot-1.jpg
          9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            kjbell Kevin Bell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes