git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27b1229
)
JAL-4375 Fix big sideways scroll from trackpad at beginning and end of visible alignment.
author
Ben Soares
<b.soares@dundee.ac.uk>
Wed, 31 Jan 2024 12:47:13 +0000
(12:47 +0000)
committer
Ben Soares
<b.soares@dundee.ac.uk>
Wed, 31 Jan 2024 12:47:13 +0000
(12:47 +0000)
src/jalview/viewmodel/ViewportRanges.java
patch
|
blob
|
history
diff --git
a/src/jalview/viewmodel/ViewportRanges.java
b/src/jalview/viewmodel/ViewportRanges.java
index
f842736
..
03d4172
100644
(file)
--- a/
src/jalview/viewmodel/ViewportRanges.java
+++ b/
src/jalview/viewmodel/ViewportRanges.java
@@
-530,21
+530,24
@@
public class ViewportRanges extends ViewportProperties
{
if (!right)
{
- if (startRes < jump)
+ if (startRes < 1)
{
return false;
}
-
- setStartRes(startRes - jump);
+ int jumpto = Math.max(startRes - jump, 0);
+ setStartRes(jumpto);
}
else
{
- if (endRes >= getVisibleAlignmentWidth() - jump)
+ int vawidth = getVisibleAlignmentWidth();
+ if (endRes >= vawidth - 1)
{
return false;
}
- setStartRes(startRes + jump);
+ int jumpto = Math.min(startRes + jump,
+ vawidth - (endRes - startRes + 1));
+ setStartRes(jumpto);
}
return true;