Skip to content

Commit

Permalink
Tweak corocomo
Browse files Browse the repository at this point in the history
  • Loading branch information
mincequi committed Oct 28, 2019
1 parent 649084f commit 2ca0b88
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions corocomo/src/EqChart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,22 @@ void EqChart::paint(QPainter *painter)

// Prepare font
auto font = painter->font();
font.setPointSize(font.pointSize()-4);
font.setPointSize(font.pointSize()-2);
painter->setFont(font);
painter->setOpacity(0.5);

auto pos = trans.map(QPoint(0, 0));
pos.rx() -= 4;
pos.ry() -= font.pointSize()/2;
auto pos = trans.map(QPointF(0, 0));
pos.rx() -= 4.0;
pos.ry() -= font.pointSizeF()/2.0;
painter->drawText(pos.x(), pos.y(), width(), 50, Qt::AlignRight, "0");

pos = trans.map(QPoint(0, -24));
pos.rx() -= 4;
pos.ry() -= font.pointSize()/2;
pos = trans.map(QPointF(0, -24));
pos.rx() -= 4.0;
pos.ry() -= font.pointSizeF()/2.0;
painter->drawText(pos.x(), pos.y(), width(), 50, Qt::AlignRight, "-24");

pos = trans.map(QPoint(0, 6));
pos.rx() -= 4;
pos.ry() -= font.pointSize()/2;
pos = trans.map(QPointF(0, 6));
pos.rx() -= 4.0;
pos.ry() -= font.pointSizeF()/2.0;
painter->drawText(pos.x(), pos.y(), width(), 50, Qt::AlignRight, "6");
}
22 changes: 11 additions & 11 deletions corocomo/src/PhaseChart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,27 @@ void PhaseChart::paint(QPainter *painter)

// Prepare font
auto font = painter->font();
font.setPointSize(font.pointSize()-4);
font.setPointSize(font.pointSize()-2);
painter->setFont(font);
painter->setOpacity(0.5);

auto pos = trans.map(QPointF(0, M_PI));
pos.rx() -= 4.0;
pos.ry() -= font.pointSize()/2.0;
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "-180");
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "-π");

pos = trans.map(QPointF(0, 2.0*M_PI));
pos.rx() -= 4;
pos.ry() -= font.pointSize()/2;
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "-360");
pos.rx() -= 4.0;
pos.ry() -= font.pointSize()/2.0;
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "-");

pos = trans.map(QPointF(0, -M_PI));
pos.rx() -= 4;
pos.ry() -= font.pointSize()/2;
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "180");
pos.rx() -= 4.0;
pos.ry() -= font.pointSize()/2.0;
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "π");

pos = trans.map(QPointF(0, -2.0*M_PI));
pos.rx() -= 4;
pos.ry() -= font.pointSize()/2;
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "360");
pos.rx() -= 4.0;
pos.ry() -= font.pointSize()/2.0;
painter->drawText(QRectF(pos.x(), pos.y(), width(), 50.0), Qt::AlignRight, "");
}
6 changes: 3 additions & 3 deletions corocomo/src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ApplicationWindow {
Label {
id: axisLabel
text: "Magnitude (dB)"
font.pointSize: font.pointSize-4
font.pointSize: font.pointSize-2
opacity: 0.5
rotation: -90
anchors.horizontalCenter: parent.horizontalCenter
Expand All @@ -112,8 +112,8 @@ ApplicationWindow {
anchors.rightMargin: phaseAxisLabel.height/2 + 4
Label {
id: phaseAxisLabel
text: "Phase (degrees)"
font.pointSize: font.pointSize-4
text: "Phase (rad)"
font.pointSize: font.pointSize-2
opacity: 0.5
rotation: -90
anchors.horizontalCenter: parent.horizontalCenter
Expand Down

0 comments on commit 2ca0b88

Please sign in to comment.