Limit duplicit symbols

This commit is contained in:
Martin Tůma 2018-11-30 09:18:56 +01:00
parent 37290e231a
commit f68573afaf

View File

@ -13,10 +13,15 @@ Text::~Text()
void Text::render(QPainter *painter) const void Text::render(QPainter *painter) const
{ {
QSet<QString> set;
for (int i = 0; i < _items.size(); i++) { for (int i = 0; i < _items.size(); i++) {
const TextItem *ti = _items.at(i); const TextItem *ti = _items.at(i);
if (ti->isVisible() && _sceneRect.intersects(ti->boundingRect())) if (ti->isVisible() && _sceneRect.intersects(ti->boundingRect())
&& !set.contains(ti->text())) {
ti->paint(painter); ti->paint(painter);
set.insert(ti->text());
}
} }
} }