projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved text colour calculation into Trace::get_text_colour
[pulseview.git]
/
pv
/
view
/
trace.cpp
diff --git
a/pv/view/trace.cpp
b/pv/view/trace.cpp
index ff1fbddbcb5305185ec1abba301cc5e3857b7c19..b3ebd95b4a7e1928b1c33370f39a1cf8506a3f86 100644
(file)
--- a/
pv/view/trace.cpp
+++ b/
pv/view/trace.cpp
@@
-147,7
+147,7
@@
void Trace::paint_label(QPainter &p, int right, bool hover)
p.drawPolygon(points, countof(points));
// Paint the text
p.drawPolygon(points, countof(points));
// Paint the text
- p.setPen(
(colour.lightness() > 64) ? Qt::black : Qt::white
);
+ p.setPen(
get_text_colour()
);
p.drawText(label_rect, Qt::AlignCenter | Qt::AlignVCenter, _name);
}
p.drawText(label_rect, Qt::AlignCenter | Qt::AlignVCenter, _name);
}
@@
-168,6
+168,11
@@
int Trace::get_y() const
return _v_offset - _view->v_offset();
}
return _v_offset - _view->v_offset();
}
+QColor Trace::get_text_colour() const
+{
+ return (_colour.lightness() > 64) ? Qt::black : Qt::white;
+}
+
void Trace::paint_axis(QPainter &p, int y, int left, int right)
{
p.setPen(AxisPen);
void Trace::paint_axis(QPainter &p, int y, int left, int right)
{
p.setPen(AxisPen);