git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3477 New jvmmemmax config option in getdown and getdown config. Set to 32G cap.
[jalview.git]
/
src
/
jalview
/
viewmodel
/
OverviewDimensions.java
diff --git
a/src/jalview/viewmodel/OverviewDimensions.java
b/src/jalview/viewmodel/OverviewDimensions.java
index
170f4e9
..
0235081
100644
(file)
--- a/
src/jalview/viewmodel/OverviewDimensions.java
+++ b/
src/jalview/viewmodel/OverviewDimensions.java
@@
-58,6
+58,10
@@
public abstract class OverviewDimensions
protected int alheight;
protected int alheight;
+ protected float widthRatio;
+
+ protected float heightRatio;
+
/**
* Create an OverviewDimensions object
*
/**
* Create an OverviewDimensions object
*
@@
-157,23
+161,25
@@
public abstract class OverviewDimensions
public float getPixelsPerCol()
{
resetAlignmentDims();
public float getPixelsPerCol()
{
resetAlignmentDims();
- return (float) width / alwidth;
+ return 1 / widthRatio;
}
public float getPixelsPerSeq()
{
resetAlignmentDims();
}
public float getPixelsPerSeq()
{
resetAlignmentDims();
- return (float) sequencesHeight / alheight;
+ return 1 / heightRatio;
}
public void setWidth(int w)
{
width = w;
}
public void setWidth(int w)
{
width = w;
+ widthRatio = (float) alwidth / width;
}
public void setHeight(int h)
{
sequencesHeight = h - graphHeight;
}
public void setHeight(int h)
{
sequencesHeight = h - graphHeight;
+ heightRatio = (float) alheight / sequencesHeight;
}
/**
}
/**
@@
-273,14
+279,14
@@
public abstract class OverviewDimensions
// boxX, boxY is the x,y location equivalent to startRes, startSeq
int xPos = Math.min(startRes, alwidth - vpwidth + 1);
// boxX, boxY is the x,y location equivalent to startRes, startSeq
int xPos = Math.min(startRes, alwidth - vpwidth + 1);
- boxX = Math.round((float) xPos * width / alwidth);
- boxY = Math.round((float) startSeq * sequencesHeight / alheight);
+ boxX = Math.round(xPos / widthRatio);
+ boxY = Math.round(startSeq / heightRatio);
// boxWidth is the width in residues translated to pixels
// boxWidth is the width in residues translated to pixels
- boxWidth = Math.round((float) vpwidth * width / alwidth);
+ boxWidth = Math.round(vpwidth / widthRatio);
// boxHeight is the height in sequences translated to pixels
// boxHeight is the height in sequences translated to pixels
- boxHeight = Math.round((float) vpheight * sequencesHeight / alheight);
+ boxHeight = Math.round(vpheight / heightRatio);
}
/**
}
/**