Bug 394742 - Shared axis plot x-zoom does not work if tied with third plot
Summary: Shared axis plot x-zoom does not work if tied with third plot
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: plotting (show other bugs)
Version: 2.0.8
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-27 11:52 UTC by manumail
Modified: 2018-09-12 19:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description manumail 2018-05-27 11:52:06 UTC
What I did:
- Create three plots A, B, C, and put two of them in a shared axis box (A, B)
- Tie the x-zoom for all three plots (Ctrl-t)
- Click on plot C to select it, then zomm right (push arrow right key)

What I expected to happen:
- All three plots should shift synchronously

What happened instead:
- While C shifts as desired, the plots A, B, with shared Axis, get shifted twice. 

I looked at the code, and found the problem dissapears, when I delete the following lines in method void ZoomCommand::redo():
foreach (ViewItem* item, _viewItems) {
  applyZoomTo(item, tiedX, tiedY);
}
Or equally, if I delete following from method ZoomCommand::ZoomCommand(PlotItem *item, const QString &text, bool forced):
_viewItems << plotItem->sharedAxisBox();


Possibly easy to fix, because_viewItems is not used in other locations. But I'm still not familiar enough with the code.

Manuel
Comment 1 Netterfield 2018-09-12 19:12:10 UTC
Git commit 64f76e7329907258be921b441b7e22ecd77fe43b by Barth Netterfield.
Committed on 12/09/2018 at 19:11.
Pushed by netterfield into branch 'master'.

Fix zooming/scrolling with tied and shared plots.

In some cases, plots that were both tied and shared would get the
command twice.  This fixes that - hopefully without regressions.

M  +4    -2    src/libkstapp/plotitem.cpp
M  +208  -155  src/libkstapp/sharedaxisboxitem.cpp

https://commits.kde.org/kst-plot/64f76e7329907258be921b441b7e22ecd77fe43b