Skip to content

Commit

Permalink
Added outline to wang template view to show selected tile
Browse files Browse the repository at this point in the history
  • Loading branch information
Bdtrotte committed Aug 15, 2017
1 parent 508f2b2 commit d8acf51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tiled/wangtemplateview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ void WangTemplateDelegate::paint(QPainter *painter,
if(wangId == 0)
return;

painter->setClipRect(option.rect);

if (WangSet *wangSet = mWangTemplateView->wangSet())
paintTemplateTile(painter, wangId,
wangSet,
Expand All @@ -258,8 +260,8 @@ void WangTemplateDelegate::paint(QPainter *painter,
//Highlight currently selected tile.
if (mWangTemplateView->currentIndex() == index) {
QColor high = option.palette.highlight().color();
painter->setBrush(QColor(high.red(), high.green(), high.blue(), 100));
painter->setPen(Qt::NoPen);
painter->setBrush(Qt::NoBrush);
painter->setPen(QPen(high, 4));
painter->drawRect(option.rect);
}

Expand Down

0 comments on commit d8acf51

Please sign in to comment.