From 133e7bdb89fee7c8385c9991e45c8834e1910b51 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 6 Jul 2017 15:59:43 +0100 Subject: [PATCH] JAL-147 prevent vertical Overview box movement in wrapped mode --- src/jalview/viewmodel/OverviewDimensionsHideHidden.java | 5 +++++ src/jalview/viewmodel/OverviewDimensionsShowHidden.java | 5 +++++ src/jalview/viewmodel/ViewportRanges.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/jalview/viewmodel/OverviewDimensionsHideHidden.java b/src/jalview/viewmodel/OverviewDimensionsHideHidden.java index 4bf7694..4d64f1c 100644 --- a/src/jalview/viewmodel/OverviewDimensionsHideHidden.java +++ b/src/jalview/viewmodel/OverviewDimensionsHideHidden.java @@ -39,6 +39,11 @@ public class OverviewDimensionsHideHidden extends OverviewDimensions y = 0; } + if (ranges.isWrappedMode()) + { + y = 0; // sorry, no vertical scroll when wrapped + } + // // Convert x value to residue position // diff --git a/src/jalview/viewmodel/OverviewDimensionsShowHidden.java b/src/jalview/viewmodel/OverviewDimensionsShowHidden.java index 2216f33..62e8000 100644 --- a/src/jalview/viewmodel/OverviewDimensionsShowHidden.java +++ b/src/jalview/viewmodel/OverviewDimensionsShowHidden.java @@ -81,6 +81,11 @@ public class OverviewDimensionsShowHidden extends OverviewDimensions y = 0; } + if (ranges.isWrappedMode()) + { + y = 0; // sorry, no vertical scroll when wrapped + } + // // Convert x value to residue position // diff --git a/src/jalview/viewmodel/ViewportRanges.java b/src/jalview/viewmodel/ViewportRanges.java index 36ed984..7c6b7ab 100644 --- a/src/jalview/viewmodel/ViewportRanges.java +++ b/src/jalview/viewmodel/ViewportRanges.java @@ -556,6 +556,11 @@ public class ViewportRanges extends ViewportProperties wrappedMode = wrapped; } + public boolean isWrappedMode() + { + return wrappedMode; + } + /** * Answers the vertical scroll position (0..) to set, given the visible column * that is at top left. Note that if called with the total visible width of -- 1.7.10.2