Prevent X axis label clipping for large font sizes

This commit is contained in:
Jan Käberich 2022-10-08 13:29:17 +02:00
parent 61a7a8e352
commit 03eac96557
2 changed files with 4 additions and 2 deletions

View File

@ -329,7 +329,8 @@ void TraceWaterfall::draw(QPainter &p)
p.setPen(QPen(pref.Graphs.Color.axis, 1)); p.setPen(QPen(pref.Graphs.Color.axis, 1));
if(displayFullFreq) { if(displayFullFreq) {
QRect bounding; QRect bounding;
p.drawText(QRect(xCoord - 40, plotAreaBottom + 5, 80, pref.Graphs.fontSizeAxis), Qt::AlignHCenter, tickValue, &bounding); p.drawText(QRect(xCoord - pref.Graphs.fontSizeAxis*2, plotAreaBottom + 5, pref.Graphs.fontSizeAxis*4,
pref.Graphs.fontSizeAxis), Qt::AlignHCenter, tickValue, &bounding);
lastTickLabelEnd = bounding.x() + bounding.width(); lastTickLabelEnd = bounding.x() + bounding.width();
} else { } else {
// check if the same prefix was used as in the fullFreq string // check if the same prefix was used as in the fullFreq string

View File

@ -627,7 +627,8 @@ void TraceXYPlot::draw(QPainter &p)
p.setPen(QPen(pref.Graphs.Color.axis, 1)); p.setPen(QPen(pref.Graphs.Color.axis, 1));
if(displayFullFreq) { if(displayFullFreq) {
QRect bounding; QRect bounding;
p.drawText(QRect(xCoord - 40, plotAreaBottom + 5, 80, pref.Graphs.fontSizeAxis), Qt::AlignHCenter, tickValue, &bounding); p.drawText(QRect(xCoord - pref.Graphs.fontSizeAxis*2, plotAreaBottom + 5, pref.Graphs.fontSizeAxis*4,
pref.Graphs.fontSizeAxis), Qt::AlignHCenter, tickValue, &bounding);
lastTickLabelEnd = bounding.x() + bounding.width(); lastTickLabelEnd = bounding.x() + bounding.width();
} else { } else {
// check if the same prefix was used as in the fullFreq string // check if the same prefix was used as in the fullFreq string