Ignore:
Timestamp:
05/16/08 10:25:28 (16 years ago)
Author:
ra33
Message:

A whole day of big changes.
Adding the ability to have Text at the end of Lines.
Also a lot of refactoring to improve the quality of code relating to constraints and lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Text.java

    r41 r50  
    905905                                Rectangle textOutline = text.getLogicalHighlightShape(0,
    906906                                                text.getCharacterCount()).getBounds();
    907                                 textOutline.translate(getX(), textY);
     907                                textOutline.width += 2;
     908                                textOutline.height += 2;
     909                               
     910                                textOutline.translate(getX() -1, textY - 1);
    908911                                if (p.intersects(textOutline))
    909912                                        return true;
     
    14511454        @Override
    14521455        public Item merge(Item merger, int mouseX, int mouseY) {
    1453                 if (merger instanceof Dot) {
    1454                         Dot d = (Dot) merger;
     1456               
     1457                if (merger.isLineEnd()) {
     1458                        if (merger instanceof Text)
     1459                                insertText(((Text)merger).getTextNoList(), mouseX, mouseY);
     1460                       
     1461                        //this.setPosition(merger.getPosition());
    14551462                        List<Line> lines = new LinkedList<Line>();
    1456                         lines.addAll(d.getLines());
    1457                         for (Line line : lines)
    1458                                 line.replaceEnd(d, this);
    1459 
    1460                         d.removeAllLines();
     1463                        lines.addAll(merger.getLines());
     1464                        for (Line line : lines){
     1465                                line.replaceEnd(merger, this);
     1466                        }
     1467                        merger.delete();
     1468                        this.setOffset(0,0);
    14611469                        return null;
    14621470                }
     
    15691577                setVisible(false);
    15701578        }
     1579       
     1580        @Override
     1581        public void anchor() {
     1582                super.anchor();
     1583                // ensure all text items have their selection cleared
     1584                clearSelection();
     1585                setAlpha(0);
     1586        }
    15711587}
Note: See TracChangeset for help on using the changeset viewer.