Allow display of controls only in currently selected mapping.

This commit is contained in:
Tats
2015-07-03 17:21:11 -06:00
parent 36c2c2b539
commit f0c4bb1fa9
2 changed files with 11 additions and 6 deletions
+10 -1
View File
@@ -21,6 +21,15 @@
#include "Mapper.h"
#include "MainWindow.h"
void VertexGraphicsItem::paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget* widget)
{
Q_UNUSED(widget);
if (((ShapeGraphicsItem*)parentItem())->getMapping()->getId() == MainWindow::instance()->getCurrentMappingId())
Util::drawControlsVertex(painter, QPointF(0,0), (option->state & QStyle::State_Selected));
}
ShapeGraphicsItem::ShapeGraphicsItem(Mapping::ptr mapping, bool output)
: _mapping(mapping), _output(output)
{
@@ -230,7 +239,7 @@ void TextureGraphicsItem::_doPaint(QPainter *painter,
// End drawing.
_postDraw(painter);
// if (selected)
if (getMapping()->getId() == MainWindow::instance()->getCurrentMappingId())
_doDrawControls(painter);
}