projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RowItem: Pass rect into label_rect
[pulseview.git]
/
pv
/
view
/
trace.cpp
diff --git
a/pv/view/trace.cpp
b/pv/view/trace.cpp
index e9235e56f2713bfd348f29ab6c3c14112968f81d..df6bd63d041ec74a4228919ea4383afb2c982ae4 100644
(file)
--- a/
pv/view/trace.cpp
+++ b/
pv/view/trace.cpp
@@
-68,7
+68,7
@@
void Trace::set_colour(QColor colour)
colour_ = colour;
}
colour_ = colour;
}
-void Trace::paint_label(QPainter &p,
int righ
t, bool hover)
+void Trace::paint_label(QPainter &p,
const QRect &rec
t, bool hover)
{
const int y = get_visual_y();
{
const int y = get_visual_y();
@@
-77,7
+77,7
@@
void Trace::paint_label(QPainter &p, int right, bool hover)
if (!enabled())
return;
if (!enabled())
return;
- const QRectF r = label_rect(r
igh
t);
+ const QRectF r = label_rect(r
ec
t);
// Paint the label
const float label_arrow_length = r.height() / 2;
// Paint the label
const float label_arrow_length = r.height() / 2;
@@
-143,7
+143,7
@@
pv::widgets::Popup* Trace::create_popup(QWidget *parent)
return popup_;
}
return popup_;
}
-QRectF Trace::label_rect(
int righ
t) const
+QRectF Trace::label_rect(
const QRectF &rec
t) const
{
using pv::view::View;
{
using pv::view::View;
@@
-156,7
+156,7
@@
QRectF Trace::label_rect(int right) const
ceilf((text_size.height() + View::LabelPadding.height() * 2) / 2) * 2);
const float half_height = label_size.height() / 2;
return QRectF(
ceilf((text_size.height() + View::LabelPadding.height() * 2) / 2) * 2);
const float half_height = label_size.height() / 2;
return QRectF(
- r
ight
- half_height - label_size.width() - 0.5,
+ r
ect.right()
- half_height - label_size.width() - 0.5,
get_visual_y() + 0.5f - half_height,
label_size.width() + half_height,
label_size.height());
get_visual_y() + 0.5f - half_height,
label_size.width() + half_height,
label_size.height());