simplify screen placement when screen is too small (#3913)

This commit is contained in:
Ben Fry
2015-10-23 15:27:29 -04:00
parent 47307254a0
commit 5acbcee17e
5 changed files with 25 additions and 7 deletions
+2
View File
@@ -101,6 +101,8 @@ editor.window.height.min = 500
editor.window.height.min.macosx = 450
# tested to be 515 on Windows XP, this leaves some room
editor.window.height.min.windows = 530
# tested with Raspberry Pi display
editor.window.height.min.linux = 480
# font size for editor
#editor.font = Monospaced,plain,12
+6 -2
View File
@@ -886,15 +886,19 @@ public class PSurfaceAWT extends PSurfaceNone {
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
locationX = editorLocation[0] + 66;
locationY = editorLocation[1] + 66;
//locationX = editorLocation[0] + 66;
//locationY = editorLocation[1] + 66;
locationX = (sketch.displayWidth - window.width) / 2;
locationY = (sketch.displayHeight - window.height) / 2;
/*
if ((locationX + window.width > sketch.displayWidth - 33) ||
(locationY + window.height > sketch.displayHeight - 33)) {
// otherwise center on screen
locationX = (sketch.displayWidth - window.width) / 2;
locationY = (sketch.displayHeight - window.height) / 2;
}
*/
frame.setLocation(locationX, locationY);
}
} else { // just center on screen
+7 -3
View File
@@ -466,6 +466,7 @@ public class PSurfaceFX implements PSurface {
stage.setY(locationY);
} else { // doesn't fit
/*
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
@@ -475,9 +476,12 @@ public class PSurfaceFX implements PSurface {
if ((locationX + stage.getWidth() > sketch.displayWidth - 33) ||
(locationY + stage.getHeight() > sketch.displayHeight - 33)) {
// otherwise center on screen
locationX = (int) ((sketch.displayWidth - stage.getWidth()) / 2);
locationY = (int) ((sketch.displayHeight - stage.getHeight()) / 2);
*/
locationX = (int) ((sketch.displayWidth - stage.getWidth()) / 2);
locationY = (int) ((sketch.displayHeight - stage.getHeight()) / 2);
/*
}
*/
stage.setX(locationX);
stage.setY(locationY);
}
@@ -951,4 +955,4 @@ public class PSurfaceFX implements PSurface {
if (ch.startsWith("\r")) return '\n'; // normalize enter key
return ch.charAt(0);
}
}
}
+6 -2
View File
@@ -540,6 +540,7 @@ public class PSurfaceJOGL implements PSurface {
window.setTopLevelPosition(locationX - w, locationY);
} else { // doesn't fit
/*
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
@@ -549,9 +550,12 @@ public class PSurfaceJOGL implements PSurface {
if ((locationX + w > sketch.displayWidth - 33) ||
(locationY + h > sketch.displayHeight - 33)) {
// otherwise center on screen
locationX = (sketch.displayWidth - w) / 2;
locationY = (sketch.displayHeight - h) / 2;
*/
locationX = (sketch.displayWidth - w) / 2;
locationY = (sketch.displayHeight - h) / 2;
/*
}
*/
window.setTopLevelPosition(locationX, locationY);
}
} else { // just center on screen
+4
View File
@@ -20,6 +20,10 @@ X Fix depth sorter ordering when two triangles in a plane share vertices
X https://github.com/processing/processing/pull/4010
X Turn off fixed rate scheduling in OpenGL
X https://github.com/processing/processing/pull/4004
X Fix GLSL preprocessing issues with variable name mangling
X https://github.com/processing/processing/pull/4052
X https://github.com/processing/processing/issues/3961
X https://github.com/processing/processing/issues/3968
andres
X cursor() fails to work as expected with P2D/P3D