Skip to content

Solid line turns into dashed (AA disabled, 1px width) #85

Description

@Aleksevs

Hello!

Tried to draw 1px polyline without antialiasing but bumped into a strange behaviour. Lines drawn almost vertically became dashed (see left pic).
paint_glitch

Drawing sequence is like following (paint method in modified HelloWidget example):

p->setLineWidth(1);
p->setPixelAlign(QNanoPainter::PIXEL_ALIGN_NONE); // (Doesn't affect anything)
p->beginPath();

p->moveTo(200+0.25, 392); // (Fraction added to make assymetry)
p->lineTo(200+0.25 + 4, 0);
//p->moveTo(200+0.25 + 4, 0); // (*) Removes dashing
p->lineTo(200+0.25 + 8, 392);

p->setStrokeStyle("#202020");
p->stroke();

At the same time, after (*) line is uncommented, the plot gets much better (right pic).
Could you please give a clue how to fix this issue without adding moveTo for each line?

PS. Qt 5.15. Debug output during start:

Creating suitable QNanoBackend for OpenGL 4.6 context
Using backend: "OpenGL 3"

Regards,
Alekseus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions