Ignore:
Timestamp:
09/26/08 13:03:26 (16 years ago)
Author:
ra33
Message:

Fixed minor bugs

File:
1 edited

Legend:

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

    r324 r336  
    602602                        if (text.charAt(0) == KeyEvent.VK_BACK_SPACE) {
    603603                                if (hasSelection()) {
    604                                         cutSelectedText();
    605                                         clearSelection();
     604                                        pos = deleteSelection(pos);
    606605                                } else if (insertPos > 0) {
    607606                                        deleteChar(insertPos - 1);
     
    612611                        } else if (text.charAt(0) == KeyEvent.VK_DELETE) {
    613612                                if (hasSelection()) {
    614                                         cutSelectedText();
    615                                         clearSelection();
     613                                        pos = deleteSelection(pos);
    616614                                } else if (insertPos < _text.length()) {
    617615                                        deleteChar(insertPos);
     
    719717        }
    720718
     719        /**
     720         * @param pos
     721         * @return
     722         */
     723        private int deleteSelection(int pos) {
     724                int selectionLength = getSelectionSize();
     725                cutSelectedText();
     726                clearSelection();
     727                pos -= selectionLength;
     728                return pos;
     729        }
     730
    721731        public Point2D.Float moveCursor(int direction, float mouseX, float mouseY,
    722732                        boolean setSelection) {
Note: See TracChangeset for help on using the changeset viewer.