Sync the replay chart cursor from every subplot, not only FN
Each subplot carries its own copy of the shared time cursor, but the drag handler always read the first copy's value, so dragging FX or FY re-read FN's unchanged position and returned without moving the others. The handler now uses the line the signal names. Verified by dragging all three cursors in the offscreen UI test and by the full studio suite (569 tests, 0 failed).
This commit is contained in:
@@ -1452,6 +1452,21 @@ def test_the_charts_zoom_and_pan_in_every_view(make_window):
|
||||
QApplication.processEvents()
|
||||
assert [round(cursor.value(), 2) for cursor in panel.cursors] == [1.25] * 3
|
||||
assert moved and moved[-1] == 1.25, "the cursor drag did not notify the replay"
|
||||
|
||||
# Every subplot carries the same cursor, so every one of them is the control.
|
||||
# Dragging FX or FY used to re-read FN's already-current value, judge it unchanged and
|
||||
# return — only the first subplot moved the other two.
|
||||
for index in (1, 2):
|
||||
moved.clear()
|
||||
target = round(1.5 + index * 0.1, 2)
|
||||
panel.cursors[index].setValue(target)
|
||||
QApplication.processEvents()
|
||||
assert [round(cursor.value(), 2) for cursor in panel.cursors] == [target] * 3, (
|
||||
f"dragging subplot {index}'s cursor did not move the other two"
|
||||
)
|
||||
assert moved and round(moved[-1], 2) == target, (
|
||||
f"dragging subplot {index}'s cursor did not notify the replay"
|
||||
)
|
||||
_finish(window, stuck)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user