simplify the divider location setup

This commit is contained in:
Ben Fry
2017-02-11 22:26:35 +00:00
parent 5e52f5326d
commit 3dbc8de85c
+5 -4
View File
@@ -219,11 +219,12 @@ public class EditorState {
void apply(Editor editor) {
editor.setBounds(editorBounds);
if (dividerLocation != 0) {
editor.setDividerLocation(dividerLocation);
} else {
editor.setDividerLocation(2 * editor.getSize().height / 3);
if (dividerLocation == 0) {
dividerLocation = 2 * editor.getSize().height / 3;
}
editor.setDividerLocation(dividerLocation);
if (isMaximized) {
editor.setExtendedState(Frame.MAXIMIZED_BOTH);
}