mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Fixed issue Adjust position of vertices using arrow keys not working on output display #77
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -51,6 +51,8 @@ private:
|
||||
protected:
|
||||
// overriden from QGlWidget:
|
||||
virtual void resizeGL(int width, int height);
|
||||
|
||||
// Event Filter
|
||||
bool eventFilter(QObject *target, QEvent *event);
|
||||
};
|
||||
|
||||
|
||||
@@ -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
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user