PDA

View Full Version : Line up graphicsitems in graphicsview



tvj4218
10th March 2017, 16:59
I've got a custom graphics item where I draw rectangles of various sizes. For some reason they don't line up with each other horizontally. The x and y position is set before the graphics item is added to the scene using addItem. I use the same x Value but vary the y value for these shapes. But the second shape is offset from the first one horizontally. So for some reason the x value for the second shape seems different. The pen width is set to 1 before drawing any of the shapes.

Santosh Reddy
15th March 2017, 06:30
Are you comparing the correct edge of the rectangle ?