mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-21 06:13:41 +00:00
Option to show markers symbols at top/bottom of graph for out-of-range markers
This commit is contained in:
parent
a28dd50e36
commit
b1c4c4ffad
4 changed files with 39 additions and 9 deletions
|
|
@ -638,13 +638,25 @@ void TraceXYPlot::draw(QPainter &p)
|
|||
p.drawLine(p1, p2);
|
||||
}
|
||||
|
||||
if(pref.Marker.clipToYAxis) {
|
||||
// clip Y coordinate of markers to visible area (always show markers, even when out of range)
|
||||
if(point.y() < plotRect.top()) {
|
||||
point.ry() = plotRect.top();
|
||||
} else if(point.y() > plotRect.bottom()) {
|
||||
point.ry() = plotRect.bottom();
|
||||
}
|
||||
}
|
||||
|
||||
if(!plotRect.contains(point)) {
|
||||
// out of screen
|
||||
continue;
|
||||
}
|
||||
auto symbol = m->getSymbol();
|
||||
point += QPoint(-symbol.width()/2, -symbol.height());
|
||||
// ignore clipRect for markers
|
||||
p.setClipping(false);
|
||||
p.drawPixmap(point, symbol);
|
||||
p.setClipping(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue