Center the test signal #97

This commit is contained in:
baydam
2015-12-29 10:34:52 +00:00
parent 23847b86ed
commit a4384faf78
2 changed files with 7 additions and 2 deletions
-1
View File
@@ -89,7 +89,6 @@ private slots:
void openRecentFile();
void clearRecentFileList();
void openRecentVideo();
//void quitMapMap();
// Edit menu.
void deleteItem();
// Context menu for mappings.
+7 -1
View File
@@ -89,8 +89,14 @@ void OutputGLCanvas::_drawTestSignal(QPainter* painter)
}
}
// Create responsive image
QImage test_signal = _svg_test_signal.scaled(geo.height(), geo.height(), Qt::KeepAspectRatio);
// Set new brush
this->_brush_test_signal = QBrush(test_signal);
// Center the brush
painter->translate((geo.width() - test_signal.width()) / 2, (geo.height() - test_signal.height()) / 2);
// Draw the actual brush.
painter->fillRect(geo, this->_brush_test_signal);
painter->fillRect(0, 0, test_signal.width(), test_signal.height(), this->_brush_test_signal);
}
void OutputGLCanvas::resizeGL(int width, int height)