projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
859eed5
)
Cursor: Don't draw cursors over each other when they have equal time
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 20 Dec 2014 18:33:35 +0000
(18:33 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sun, 28 Dec 2014 18:52:53 +0000
(18:52 +0000)
pv/view/cursor.cpp
patch
|
blob
|
history
diff --git
a/pv/view/cursor.cpp
b/pv/view/cursor.cpp
index 0ea6f5ab7b0c5e3edbc21b64600bc06e2f1346dd..512b5fa9791425a6a84f8de5a12bab1f61d6ab2f 100644
(file)
--- a/
pv/view/cursor.cpp
+++ b/
pv/view/cursor.cpp
@@
-32,8
+32,11
@@
#include <cassert>
#include <cstdio>
#include <cassert>
#include <cstdio>
+#include <limits>
+using std::abs;
using std::shared_ptr;
using std::shared_ptr;
+using std::numeric_limits;
namespace pv {
namespace view {
namespace pv {
namespace view {
@@
-72,7
+75,10
@@
QRectF Cursor::label_rect(const QRectF &rect) const
TimeMarker::ArrowSize - 0.5f;
const float height = label_size.height();
TimeMarker::ArrowSize - 0.5f;
const float height = label_size.height();
- if (time_ > other->time())
+ const double other_time = other->time();
+ if (time_ > other_time ||
+ (abs(time_ - other_time) < numeric_limits<double>::epsilon() &&
+ this > other.get()))
return QRectF(x, top, label_size.width(), height);
else
return QRectF(x - label_size.width(), top,
return QRectF(x, top, label_size.width(), height);
else
return QRectF(x - label_size.width(), top,