jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
changeset 31884 15ece91df8e9
parent 30926 59dd8fec081b
child 32131 f6daa59ae211
equal deleted inserted replaced
31883:be405ebc8355 31884:15ece91df8e9
   969         Dimension d = new Dimension();
   969         Dimension d = new Dimension();
   970         if (doc instanceof AbstractDocument) {
   970         if (doc instanceof AbstractDocument) {
   971             ((AbstractDocument)doc).readLock();
   971             ((AbstractDocument)doc).readLock();
   972         }
   972         }
   973         try {
   973         try {
   974             d.width = (int) rootView.getMinimumSpan(View.X_AXIS) + i.left + i.right;
   974             d.width = (int) rootView.getMinimumSpan(View.X_AXIS) + i.left + i.right + caretMargin;
   975             d.height = (int)  rootView.getMinimumSpan(View.Y_AXIS) + i.top + i.bottom;
   975             d.height = (int)  rootView.getMinimumSpan(View.Y_AXIS) + i.top + i.bottom;
   976         } finally {
   976         } finally {
   977             if (doc instanceof AbstractDocument) {
   977             if (doc instanceof AbstractDocument) {
   978                 ((AbstractDocument)doc).readUnlock();
   978                 ((AbstractDocument)doc).readUnlock();
   979             }
   979             }
   994         if (doc instanceof AbstractDocument) {
   994         if (doc instanceof AbstractDocument) {
   995             ((AbstractDocument)doc).readLock();
   995             ((AbstractDocument)doc).readLock();
   996         }
   996         }
   997         try {
   997         try {
   998             d.width = (int) Math.min((long) rootView.getMaximumSpan(View.X_AXIS) +
   998             d.width = (int) Math.min((long) rootView.getMaximumSpan(View.X_AXIS) +
   999                                      (long) i.left + (long) i.right, Integer.MAX_VALUE);
   999                                      (long) i.left + (long) i.right + caretMargin, Integer.MAX_VALUE);
  1000             d.height = (int) Math.min((long) rootView.getMaximumSpan(View.Y_AXIS) +
  1000             d.height = (int) Math.min((long) rootView.getMaximumSpan(View.Y_AXIS) +
  1001                                       (long) i.top + (long) i.bottom, Integer.MAX_VALUE);
  1001                                       (long) i.top + (long) i.bottom, Integer.MAX_VALUE);
  1002         } finally {
  1002         } finally {
  1003             if (doc instanceof AbstractDocument) {
  1003             if (doc instanceof AbstractDocument) {
  1004                 ((AbstractDocument)doc).readUnlock();
  1004                 ((AbstractDocument)doc).readUnlock();
  1025         if ((alloc.width > 0) && (alloc.height > 0)) {
  1025         if ((alloc.width > 0) && (alloc.height > 0)) {
  1026             alloc.x = alloc.y = 0;
  1026             alloc.x = alloc.y = 0;
  1027             Insets insets = editor.getInsets();
  1027             Insets insets = editor.getInsets();
  1028             alloc.x += insets.left;
  1028             alloc.x += insets.left;
  1029             alloc.y += insets.top;
  1029             alloc.y += insets.top;
  1030             alloc.width -= insets.left + insets.right;
  1030             alloc.width -= insets.left + insets.right + caretMargin;
  1031             alloc.height -= insets.top + insets.bottom;
  1031             alloc.height -= insets.top + insets.bottom;
  1032             return alloc;
  1032             return alloc;
  1033         }
  1033         }
  1034         return null;
  1034         return null;
  1035     }
  1035     }