/[classpath]/classpath/javax/swing/text/CompositeView.java
ViewVC logotype

Diff of /classpath/javax/swing/text/CompositeView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by rabbit78, Tue Sep 13 23:44:49 2005 UTC revision 1.7 by rabbit78, Thu Oct 6 20:16:32 2005 UTC
# Line 434  public abstract class CompositeView Line 434  public abstract class CompositeView
434     */     */
435    protected int getViewIndexAtPosition(int pos)    protected int getViewIndexAtPosition(int pos)
436    {    {
437      // We have one child view allocated for each child element in      int index = -1;
438      // loadChildren(), so this should work.      for (int i = 0; i < children.length; i++)
439      Element el = getElement();        {
440      int index = el.getElementIndex(pos);          if (children[i].getStartOffset() >= pos
441                && children[i].getEndOffset() < pos)
442              {
443                index = i;
444                break;
445              }
446          }
447      return index;      return index;
448    }    }
449    
# Line 474  public abstract class CompositeView Line 480  public abstract class CompositeView
480              insideAllocation = inside;              insideAllocation = inside;
481            }            }
482        }        }
483      inside.x = alloc.x - insets.left;      inside.x = alloc.x + insets.left;
484      inside.y = alloc.y - insets.top;      inside.y = alloc.y + insets.top;
485      inside.width = alloc.width - insets.left - insets.right;      inside.width = alloc.width - insets.left - insets.right;
486      inside.height = alloc.height - insets.top - insets.bottom;      inside.height = alloc.height - insets.top - insets.bottom;
487      return inside;      return inside;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26