PDA

View Full Version : How to draw lines with the right width?



albanelporto
22nd November 2006, 10:24
Hallo people,

I'm using QGraphicsView and I have a QGraphicsScene with many QGraphicsItems that are simple lines. All the lines are horizontal, vertical or 45° inclinated.

My problem is that on the screen some lines are painted wider than other even if all of them are created with the same width and the same inclination. This behaviour depends on the zoom applied.

I want to make a 2D CAD application and I don't want to use antialiasing when I draw lines (is it right that all 2D CAD application don't use antialiasing in drawing lines?).

Please suggest me a solution.

wysota
22nd November 2006, 10:42
Why shouldn't CAD applications use antialiasing? Antialiasing just makes lines look smoother, it doesn't modify them in any way.

albanelporto
22nd November 2006, 10:50
I'm not sure but I think that when you zoom a group of black paralle lines in 2D CAD you dont see any gray pixels. This is evident when the lines are drawed with the width of 1 or 2 or 3 pixels on the screen.

Maybe I'm wrong...

wysota
22nd November 2006, 11:51
If you do the scaling correctly, zooming shouldn't interfere.