Fixed issue Adjust position of vertices using arrow keys not working on output display #77

This commit is contained in:
baydam
2014-11-05 17:17:37 +00:00
parent f6711ed7a8
commit 539d189f9d
5 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -93,6 +93,7 @@ void DestinationGLCanvas::doDraw(QPainter* painter)
painter->drawLine(0, cursorPosition.y(), geo.width(), cursorPosition.y());
}
}
}
void DestinationGLCanvas::_drawTestSignal(QPainter* painter)
@@ -145,8 +146,8 @@ bool DestinationGLCanvas::eventFilter(QObject *target, QEvent *event)
if (event->type() == QEvent::KeyPress)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
setActiveVertexIndex(getMainWindow()->getOutputWindow()->getCanvas()->getActiveVertexIndex());
MapperGLCanvas::keyPressEvent(keyEvent);
qDebug() << "Test:" << keyEvent << endl;
return true;
}
else
+2
View File
@@ -51,6 +51,8 @@ private:
protected:
// overriden from QGlWidget:
virtual void resizeGL(int width, int height);
// Event Filter
bool eventFilter(QObject *target, QEvent *event);
};
+1
View File
@@ -358,6 +358,7 @@ public:
Mapper::ptr getMapperByMappingId(uint id) { return mappers[id]; }
uid getCurrentPaintId() const { return currentPaintId; }
uid getCurrentMappingId() const { return currentMappingId; }
OutputGLWindow* getOutputWindow() const { return outputWindow; }
bool hasCurrentPaint() const { return _hasCurrentPaint; }
bool hasCurrentMapping() const { return _hasCurrentMapping; }
void setCurrentPaint(int uid);
+3 -2
View File
@@ -125,6 +125,7 @@ void MapperGLCanvas::mousePressEvent(QMouseEvent* event)
{
_activeVertex = i;
minDistance = dist;
_mousePressedOnVertex = true;
mousePressedOnSomething = true;
}
@@ -219,7 +220,7 @@ void MapperGLCanvas::mouseMoveEvent(QMouseEvent* event)
shape->translate(event->x() - prevMousePosition.x(), event->y() - prevMousePosition.y());
update();
emit shapeChanged(getCurrentShape());
}
}
else
_shapeFirstGrab = false;
}
@@ -320,7 +321,7 @@ void MapperGLCanvas::keyPressEvent(QKeyEvent* event)
// emit quadChanged();
}
void MapperGLCanvas::paintEvent(QPaintEvent* /* event */)
void MapperGLCanvas::paintEvent(QPaintEvent* )
{
makeCurrent();
+3
View File
@@ -79,6 +79,9 @@ public:
/// Returns the currently active (ie. selected) vertex, or NO_VERTEX if none is currently active.
int getActiveVertexIndex() const { return _activeVertex; }
/// Set the currently active vertex
void setActiveVertexIndex(int activeVertex) { _activeVertex = activeVertex; }
protected:
void initializeGL();
void resizeGL(int width, int height);