Skip to content

Commit

Permalink
Fixed|Shell|Qt: Thickness of lines in map overview (with Qt 5)
Browse files Browse the repository at this point in the history
The default pen behavior in Qt 5 has been changed so that any
transformations affect the pen width.
  • Loading branch information
skyjake committed Jul 8, 2014
1 parent e7a9c99 commit e600369
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doomsday/tools/shell/shell-gui/src/statuswidget.cpp
Expand Up @@ -81,17 +81,21 @@ void StatusWidget::setGameState(QString mode, QString rules, QString mapId, QStr

void StatusWidget::setMapOutline(shell::MapOutlinePacket const &outline)
{
d->mapBounds = QRect();
d->mapBounds = QRect();
d->mapOutline = QPicture();

QPainter painter(&d->mapOutline);
for(int i = 0; i < outline.lineCount(); ++i)
{
shell::MapOutlinePacket::Line const &ln = outline.line(i);
painter.setPen(ln.type == shell::MapOutlinePacket::OneSidedLine? Qt::black : Qt::gray);
QPen pen(ln.type == shell::MapOutlinePacket::OneSidedLine? Qt::black : Qt::gray);
#ifdef DENG2_QT_5_0_OR_NEWER
pen.setCosmetic(true); // transformation will not affect line width
#endif
painter.setPen(pen);

QPoint a(ln.start.x, -ln.start.y);
QPoint b(ln.end.x, -ln.end.y);
QPoint b(ln.end.x, -ln.end.y);

painter.drawLine(a, b);

Expand Down

0 comments on commit e600369

Please sign in to comment.