Ignore:
Timestamp:
07/15/08 12:55:33 (16 years ago)
Author:
ra33
Message:

Fixed some repaint issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/agents/Format.java

    r133 r143  
    22
    33import java.util.ArrayList;
     4import java.util.Collection;
    45import java.util.Collections;
    56import java.util.Comparator;
     
    1011import org.expeditee.gui.FrameUtils;
    1112import org.expeditee.items.Item;
     13import org.expeditee.items.Text;
    1214
    1315/**
     
    4244        @Override
    4345        public Frame process(Frame start) {
     46                //Check the position of the cursor and only format stuff inside the same box as the cursor
     47                Collection<Text> itemsToFormat = FrameUtils.getCurrentTextItems();
     48                if(itemsToFormat.size() <= 1){
     49                        itemsToFormat = start.getBodyTextItems(true);
     50                }
     51               
    4452                ArrayList<Item> columnHeads = new ArrayList<Item>();
    4553
    4654                ArrayList<ArrayList<Item>> columns = new ArrayList<ArrayList<Item>>();
    4755
    48                 for (Item t : start.getBodyTextItems(true)) {
     56                for (Item t : itemsToFormat) {
    4957                        int col = findColumn(columnHeads, t);
    5058                        // if this is the head of a new column
Note: See TracChangeset for help on using the changeset viewer.