projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix an isnan() issue on (at least) MinGW and Mac OS X.
[pulseview.git]
/
pv
/
view
/
trace.cpp
diff --git
a/pv/view/trace.cpp
b/pv/view/trace.cpp
index 8411612b14a1aac109fd5cc84587efbd620f4ea3..a96b0327e0e6ffd6f5364876b928ebaa87077daf 100644
(file)
--- a/
pv/view/trace.cpp
+++ b/
pv/view/trace.cpp
@@
-134,6
+134,8
@@
pv::widgets::Popup* Trace::create_popup(QWidget *parent)
using pv::widgets::Popup;
popup_ = new Popup(parent);
using pv::widgets::Popup;
popup_ = new Popup(parent);
+ popup_->set_position(parent->mapToGlobal(
+ point(parent->rect())), Popup::Right);
create_popup_form();
create_popup_form();
@@
-149,11
+151,10
@@
QRectF Trace::label_rect(const QRectF &rect) const
QFontMetrics m(QApplication::font());
const QSize text_size(
QFontMetrics m(QApplication::font());
const QSize text_size(
- m.boundingRect(QRect(), 0, name_).width(),
- m.boundingRect(QRect(), 0, "Tg").height());
+ m.boundingRect(QRect(), 0, name_).width(), m.height());
const QSizeF label_size(
const QSizeF label_size(
- text_size.width() +
View::
LabelPadding.width() * 2,
- ceilf((text_size.height() +
View::
LabelPadding.height() * 2) / 2) * 2);
+ text_size.width() + LabelPadding.width() * 2,
+ ceilf((text_size.height() + LabelPadding.height() * 2) / 2) * 2);
const float half_height = label_size.height() / 2;
return QRectF(
rect.right() - half_height - label_size.width() - 0.5,
const float half_height = label_size.height() / 2;
return QRectF(
rect.right() - half_height - label_size.width() - 0.5,
@@
-162,6
+163,13
@@
QRectF Trace::label_rect(const QRectF &rect) const
label_size.height());
}
label_size.height());
}
+QRectF Trace::hit_box_rect(const QRectF &rect) const
+{
+ const float h = QFontMetrics(QApplication::font()).height();
+ return QRectF(rect.left(), get_visual_y() - h / 2.0f,
+ rect.width(), h);
+}
+
void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)
{
p.setPen(AxisPen);
void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)
{
p.setPen(AxisPen);