mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-07 23:43:42 +00:00
Improve graph axis labeling
- Use correct Y height to display full font - Fix floating point issue when calculating amount of displayed digits in Unit::ToString
This commit is contained in:
parent
5f022c42b6
commit
1aaba21723
4 changed files with 15 additions and 15 deletions
|
|
@ -478,7 +478,7 @@ void EyeDiagramPlot::draw(QPainter &p)
|
|||
prefix = "um ";
|
||||
}
|
||||
auto tickValue = Unit::ToString(yAxis.getTicks()[j], unit, prefix, significantDigits);
|
||||
p.drawText(QRectF(0, yCoord - pref.Graphs.fontSizeAxis/2 - 2, tickStart + 2 * tickLen, pref.Graphs.fontSizeAxis), Qt::AlignRight, tickValue);
|
||||
p.drawText(QRectF(0, yCoord - pref.Graphs.fontSizeAxis/2 - 2, tickStart + 2 * tickLen, pref.Graphs.fontSizeAxis*1.5), Qt::AlignRight, tickValue);
|
||||
|
||||
// tick lines
|
||||
if(yCoord == plotAreaTop || yCoord == plotAreaBottom) {
|
||||
|
|
@ -547,7 +547,7 @@ void EyeDiagramPlot::draw(QPainter &p)
|
|||
p.setPen(QPen(pref.Graphs.Color.axis, 1));
|
||||
QRect bounding;
|
||||
p.drawText(QRect(xCoord - pref.Graphs.fontSizeAxis*4, plotAreaBottom + 5, pref.Graphs.fontSizeAxis*8,
|
||||
pref.Graphs.fontSizeAxis), Qt::AlignHCenter, tickValue, &bounding);
|
||||
pref.Graphs.fontSizeAxis*1.5), Qt::AlignHCenter, tickValue, &bounding);
|
||||
lastTickLabelEnd = bounding.x() + bounding.width();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue