Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Aleksevs opened this issue May 13, 2024 · 0 comments
Open

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

Aleksevs opened this issue May 13, 2024 · 0 comments

Comments

@Aleksevs
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant