From 8ca642e9a2b417a1016d0dcee373a0f96ae57a0d Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 22 Oct 2012 17:46:22 +0000 Subject: [PATCH] fix problem with large fonts causing the console to disappear (issue #1275) --- app/src/processing/app/Editor.java | 3 --- app/src/processing/app/syntax/JEditTextArea.java | 2 +- app/src/processing/app/syntax/PdeTextAreaDefaults.java | 4 +++- todo.txt | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 6f4c5a34e..099c8b4a5 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -234,9 +234,7 @@ public abstract class Editor extends JFrame implements RunnerListener { // end an undo-chunk any time the caret moves unless it's when text is edited textarea.addCaretListener(new CaretListener() { - String lastText = textarea.getText(); - public void caretUpdate(CaretEvent e) { String newText = textarea.getText(); if (lastText.equals(newText) && isDirectEdit()) { @@ -252,7 +250,6 @@ public abstract class Editor extends JFrame implements RunnerListener { pack(); // Set the window bounds and the divider location before setting it visible -// setPlacement(location); state.apply(this); // Set the minimum size for the editor window diff --git a/app/src/processing/app/syntax/JEditTextArea.java b/app/src/processing/app/syntax/JEditTextArea.java index 6bf0646e4..d52cdade1 100644 --- a/app/src/processing/app/syntax/JEditTextArea.java +++ b/app/src/processing/app/syntax/JEditTextArea.java @@ -309,7 +309,7 @@ public class JEditTextArea extends JComponent // http://code.google.com/p/processing/issues/detail?id=280 // http://code.google.com/p/processing/issues/detail?id=316 //setValues(int newValue, int newExtent, int newMin, int newMax) - if ( (-horizontalOffset) > 0 ){ + if (horizontalOffset < 0) { horizontal.setValues(-horizontalOffset, painterWidth, -leftHandGutter, width); } else { horizontal.setValues(-leftHandGutter, painterWidth, -leftHandGutter, width); diff --git a/app/src/processing/app/syntax/PdeTextAreaDefaults.java b/app/src/processing/app/syntax/PdeTextAreaDefaults.java index c722fa2f2..c57e079e6 100644 --- a/app/src/processing/app/syntax/PdeTextAreaDefaults.java +++ b/app/src/processing/app/syntax/PdeTextAreaDefaults.java @@ -139,7 +139,9 @@ public class PdeTextAreaDefaults extends TextAreaDefaults { caretVisible = true; caretBlinks = true; cols = 80; - rows = 15; + // Set the number of rows lower to avoid layout badness with large fonts + // http://code.google.com/p/processing/issues/detail?id=1275 + rows = 5; font = Preferences.getFont("editor.font"); antialias = Preferences.getBoolean("editor.antialias"); diff --git a/todo.txt b/todo.txt index 9a92f8c38..7b447142b 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,6 @@ 0213 pde +X Console disappears with increased editor font size +X http://code.google.com/p/processing/issues/detail?id=1275 2.0 FINAL / library/tool/mode manager cleanup