Skip to content

Commit 255bde2

Browse files
committed
add restriction on the values of (x,y),if the value of x is less than -width or the value of y is less than -height,the windows will be hidden.
1 parent 40869ad commit 255bde2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: src/main/java/org/broad/igv/prefs/IGVPreferences.java

+7
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,13 @@ public File getLastGenomeImportDirectory() {
568568
public void setApplicationFrameBounds(Rectangle bounds) {
569569

570570
if (bounds.width > 0 && bounds.height > 0) {
571+
// check the values of MaxX(x+width) and MaxY(y+width)
572+
if(bounds.getMaxY()<300) {
573+
bounds.setLocation(bounds.x,0);
574+
}
575+
if(bounds.getMaxX()<300) {
576+
bounds.setLocation(0,bounds.y);
577+
}
571578
StringBuffer buffer = new StringBuffer();
572579
buffer.append(bounds.x);
573580
buffer.append(",");

Diff for: src/main/java/org/broad/igv/ui/IGV.java

+2
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ public void windowGainedFocus(WindowEvent windowEvent) {
247247
Rectangle applicationBounds = preferences.getApplicationFrameBounds();
248248

249249
if (applicationBounds == null || applicationBounds.getMaxX() > screenBounds.getWidth() ||
250+
applicationBounds.getMaxX() < 300 ||
250251
applicationBounds.getMaxY() > screenBounds.getHeight() ||
252+
applicationBounds.getMaxY() < 300 ||
251253
applicationBounds.width == 0 || applicationBounds.height == 0) {
252254
int width = Math.min(1150, (int) screenBounds.getWidth());
253255
int height = Math.min(800, (int) screenBounds.getHeight());

0 commit comments

Comments
 (0)