Skip to content

Commit

Permalink
Add move item to graph dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleBakker committed Sep 22, 2023
1 parent f9efa8d commit 621f267
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions x-IMU3-GUI/Source/Windows/Graphs/GraphWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,22 @@ juce::PopupMenu GraphWindow::getMenu()
settings.horizontalAutoscale = !settings.horizontalAutoscale;
writeToValueTree(settings);
});
menu.addItem("Move Left (Mouse Drag)", graph.getSettings().horizontalAutoscale == false, false, [this]
{
auto settings = graph.getSettings();
const auto offset = settings.axesLimits.x.getRange() / 2;
settings.axesLimits.x.min -= offset;
settings.axesLimits.x.max -= offset;
writeToValueTree(settings);
});
menu.addItem("Move Right (Mouse Drag)", graph.getSettings().horizontalAutoscale == false, false, [this]
{
auto settings = graph.getSettings();
const auto offset = settings.axesLimits.x.getRange() / 2;
settings.axesLimits.x.min += offset;
settings.axesLimits.x.max += offset;
writeToValueTree(settings);
});
menu.addItem("Zoom In (Scroll)", graph.getSettings().horizontalAutoscale == false, false, [this]
{
zoomHorizontal(0.5f);
Expand All @@ -269,6 +285,22 @@ juce::PopupMenu GraphWindow::getMenu()
settings.verticalAutoscale = !settings.verticalAutoscale;
writeToValueTree(settings);
});
menu.addItem("Move Up (Mouse Drag)", graph.getSettings().verticalAutoscale == false, false, [this]
{
auto settings = graph.getSettings();
const auto offset = settings.axesLimits.y.getRange() / 2;
settings.axesLimits.y.min += offset;
settings.axesLimits.y.max += offset;
writeToValueTree(settings);
});
menu.addItem("Move Down (Mouse Drag)", graph.getSettings().verticalAutoscale == false, false, [this]
{
auto settings = graph.getSettings();
const auto offset = settings.axesLimits.y.getRange() / 2;
settings.axesLimits.y.min -= offset;
settings.axesLimits.y.max -= offset;
writeToValueTree(settings);
});
menu.addItem("Zoom In (Alt+Scroll)", graph.getSettings().verticalAutoscale == false, false, [this]
{
zoomVertical(0.5f);
Expand Down

0 comments on commit 621f267

Please sign in to comment.