changeset 12332:b8ad62596d8f

8098835: [PIT] Endless loop in JEditorPane Reviewed-by: alexsch, serb
author ssadetsky
date Fri, 10 Jul 2015 21:19:41 +0300
parents 5f4dc7fd84da
children 8993e87139ec
files src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Fri Jul 10 15:38:40 2015 +0300
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Fri Jul 10 21:19:41 2015 +0300
@@ -971,7 +971,7 @@
             ((AbstractDocument)doc).readLock();
         }
         try {
-            d.width = (int) rootView.getMinimumSpan(View.X_AXIS) + i.left + i.right;
+            d.width = (int) rootView.getMinimumSpan(View.X_AXIS) + i.left + i.right + caretMargin;
             d.height = (int)  rootView.getMinimumSpan(View.Y_AXIS) + i.top + i.bottom;
         } finally {
             if (doc instanceof AbstractDocument) {
@@ -996,7 +996,7 @@
         }
         try {
             d.width = (int) Math.min((long) rootView.getMaximumSpan(View.X_AXIS) +
-                                     (long) i.left + (long) i.right, Integer.MAX_VALUE);
+                                     (long) i.left + (long) i.right + caretMargin, Integer.MAX_VALUE);
             d.height = (int) Math.min((long) rootView.getMaximumSpan(View.Y_AXIS) +
                                       (long) i.top + (long) i.bottom, Integer.MAX_VALUE);
         } finally {
@@ -1027,7 +1027,7 @@
             Insets insets = editor.getInsets();
             alloc.x += insets.left;
             alloc.y += insets.top;
-            alloc.width -= insets.left + insets.right;
+            alloc.width -= insets.left + insets.right + caretMargin;
             alloc.height -= insets.top + insets.bottom;
             return alloc;
         }