mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Fix graph legends on low dpi screens
This commit is contained in:
parent
a91a11a7b9
commit
b98cdffad0
@ -1019,7 +1019,10 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
painter.setPen(Qt::black);
|
||||
painter.drawText(rec, Qt::AlignBottom | Qt::AlignRight, text);
|
||||
|
||||
painter.setPen(QPen(chan.defaultColor(), 1 * ratioY));
|
||||
float ps = 1 * ratioY;
|
||||
ps = qMax(ps, 1.0f);
|
||||
|
||||
painter.setPen(QPen(chan.defaultColor(), ps));
|
||||
int linewidth = (10 * ratioX);
|
||||
int yp = rec.top()+(rec.height()/2);
|
||||
painter.drawLine(rec.left()-linewidth, yp , rec.left()-(2 * ratioX), yp);
|
||||
@ -1051,7 +1054,9 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
|
||||
QColor color = chan.calc[dot.type].color;
|
||||
color.setAlpha(200);
|
||||
painter.setPen(QPen(QBrush(color),1 * ratioY,Qt::DotLine));
|
||||
float ps = 1 * ratioY;
|
||||
ps = qMax(ps, 1.0f);
|
||||
painter.setPen(QPen(QBrush(color), ps,Qt::DotLine));
|
||||
|
||||
int yp = rec.top()+(rec.height()/2);
|
||||
painter.drawLine(rec.left()-linewidth, yp , rec.left()-(2 * ratioX), yp);
|
||||
|
@ -53,7 +53,11 @@ int gXAxis::minimumHeight()
|
||||
{
|
||||
QFontMetrics fm(*defaultfont);
|
||||
int h = fm.height();
|
||||
#if defined(Q_OS_MAC)
|
||||
return 9+h;
|
||||
#else
|
||||
return 11+h;
|
||||
#endif
|
||||
}
|
||||
|
||||
void gXAxis::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
@ -243,9 +247,12 @@ void gXAxis::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
|
||||
//py+=usepixmap ? 20 : left;
|
||||
|
||||
int mintop = top + 4.0 * (float(y) / 10.0);
|
||||
int mintop = top + 3.0 * (float(y) / 10.0);
|
||||
int majtop = top + 6.0 * (float(y) / 10.0);
|
||||
int texttop = majtop + y + 2; // 18*w.printScaleY();
|
||||
int texttop = majtop + y; // 18*w.printScaleY();
|
||||
#if defined (Q_OS_MAC)
|
||||
texttop += 2
|
||||
#endif
|
||||
|
||||
// Fill in the minor tick marks up to the first major alignment tick
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user