Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
4.8.4, 5.2.1, 5.3.0 Beta1, 5.3.1
-
None
-
Win7
visual studio 2012
Description
When rendering text and he font color aplha component is not 255, each character is aligned differently. This is not the case when rendering opaque text. I expect text positions not to change when using different colors.
Attached is the result I get when executing the code below:
QImage Image(100, 100, QImage::Format_RGB32);
Image.fill(QColor(255,255,255,255));
QPainter painter(&Image);
QPen pen;
//change 128 to 255 and text is rendered on a different position, "correctly"
pen.setColor(QColor(0,0,0,128));
pen.setWidth(1);
painter.setPen(pen);
QFont Font("Verdana");
Font.setPointSize(10);
painter.setFont(Font);
QTextOption to;
to.setAlignment(Qt::AlignLeft | Qt::AlignTop);
painter.drawText(QRect(50, -5, 500, 20), "abcd", to);
Image.save("C:
bmp.BMP");