Details
-
Bug
-
Resolution: Done
-
P4: Low
-
4.4.1
-
None
-
c28efecdcfdd5fa0049bf482cb102814338c0d99
Description
Running the test code below will show that the behavior of flat rects varies for Arcs and Ellipses.
For flat arcs, QPainter draws what appears to be a line which is the correct behavior. This is because the bounding rect for a flat rect is actually the flat rect adjusted in each coordinate direction by line width / 2.0. Therefore, the bounding rect is non-flat and accommodates the "mathematical" line exactly as it would be painted on a device. This also coincides with the definition of bounding rect painting behaviour
in QGraphicsItem.
For flat ellipses, QPainter does not draw what appears to be a line which is incorrect behavior.
Test code:
//---------------------------------------------------------
#include <QtGui>
class MyWidget : public QWidget
{
void paintEvent(QPaintEvent * event)
};
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
MyWidget widget;
widget.setGeometry(0, 0, 120, 200);
widget.show();
return app.exec();
}
//---------------------------------------------------------