我把一个带有文本的QPainterPath放在一起,然后绘制它,首先是用QPainter::strokePath,然后是QPainter::fillPath。但是,笔划会出现瑕疵,如图所示。我做错了什么/如何防止这种情况?我应该把它报告为bug吗?

发布于 2018-07-12 05:50:02
我发现,与使用strokePath和fillPath相比,下面的代码可以在没有伪影的情况下工作,而且渲染速度更快:
if(outlineEnabled) {
p.setBrush(Qt::NoBrush);
p.setPen(QPen(outlineColor, outlineWidth/scaleFactor, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
for(const auto &polygon : path.toSubpathPolygons())
p.drawPolygon(polygon, Qt::OddEvenFill);
}
p.setBrush(color);
p.setPen(Qt::NoPen);
for(const auto &polygon : path.toFillPolygons())
p.drawPolygon(polygon, Qt::OddEvenFill);https://stackoverflow.com/questions/51294546
复制相似问题