Skip to content

Commit

Permalink
add restriction on the values of (x,y),if the value of x is less than…
Browse files Browse the repository at this point in the history
… -width or the value of y is less than -height,the windows will be hidden.
  • Loading branch information
kunmonster committed Sep 27, 2024
1 parent 40869ad commit 255bde2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/org/broad/igv/prefs/IGVPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,13 @@ public File getLastGenomeImportDirectory() {
public void setApplicationFrameBounds(Rectangle bounds) {

if (bounds.width > 0 && bounds.height > 0) {
// check the values of MaxX(x+width) and MaxY(y+width)
if(bounds.getMaxY()<300) {
bounds.setLocation(bounds.x,0);
}
if(bounds.getMaxX()<300) {
bounds.setLocation(0,bounds.y);
}
StringBuffer buffer = new StringBuffer();
buffer.append(bounds.x);
buffer.append(",");
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/broad/igv/ui/IGV.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ public void windowGainedFocus(WindowEvent windowEvent) {
Rectangle applicationBounds = preferences.getApplicationFrameBounds();

if (applicationBounds == null || applicationBounds.getMaxX() > screenBounds.getWidth() ||
applicationBounds.getMaxX() < 300 ||
applicationBounds.getMaxY() > screenBounds.getHeight() ||
applicationBounds.getMaxY() < 300 ||
applicationBounds.width == 0 || applicationBounds.height == 0) {
int width = Math.min(1150, (int) screenBounds.getWidth());
int height = Math.min(800, (int) screenBounds.getHeight());
Expand Down

0 comments on commit 255bde2

Please sign in to comment.