mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
Better X axis ticks in manual mode, minor cleanup for siunitedit
This commit is contained in:
parent
af8787915c
commit
fe78ccdeeb
2 changed files with 6 additions and 3 deletions
|
|
@ -237,7 +237,11 @@ void TraceXYPlot::draw(QPainter &p)
|
|||
// draw X ticks
|
||||
// this only works for evenly distributed ticks:
|
||||
auto max = qMax(abs(XAxis.ticks.front()), abs(XAxis.ticks.back()));
|
||||
auto minLabel = qMin(abs(XAxis.ticks.front()), abs(XAxis.ticks.back()));
|
||||
auto step = abs(XAxis.ticks[0] - XAxis.ticks[1]);
|
||||
if(minLabel > 0 && minLabel < step) {
|
||||
step = minLabel;
|
||||
}
|
||||
int significantDigits = floor(log10(max)) - floor(log10(step)) + 1;
|
||||
bool displayFullFreq = significantDigits <= 5;
|
||||
constexpr int displayLastDigits = 4;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue