Changeset 1126 for trunk


Ignore:
Timestamp:
09/13/18 15:15:05 (6 years ago)
Author:
bln4
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java

    r1122 r1126  
    400400                        public void exec(Gesture gesture) {
    401401                                InsertStringGestureData data = (InsertStringGestureData) gesture.getData();
    402                                 for (char c : data.getString().toCharArray()) processChar(c, data.isShiftDown());
     402                                for (char c : data.getString().toCharArray()) {
     403                                        processChar(c, data.isShiftDown());
     404                                }
    403405                        }
    404406                });
     
    11251127                        assert (_toRemove.getLength() == 0);
    11261128                        // This line is to protect mistaken removal of items if there is a bug...
    1127                         if (_toRemove.getLength() == 0) DisplayController.getCurrentFrame().removeItem(_toRemove);
     1129                        if (_toRemove.getLength() == 0) {
     1130                                DisplayController.getCurrentFrame().removeItem(_toRemove);
     1131                        }
    11281132                }
    11291133                _toRemove = null;
    11301134
    11311135                // ignore delete and backspace if in free space
    1132                 if ((on == null || !(on instanceof Text)) && (ch == '\b' || ch == '\t' || ch == Text.DELETE_CHARACTER)) return;
     1136                if ((on == null || !(on instanceof Text))
     1137                                && (ch == '\b' || ch == '\t' || ch == Text.DELETE_CHARACTER)) {
     1138                        return;
     1139                }
    11331140
    11341141                SessionStats.TypedChar(ch);
     
    11441151
    11451152                // only text can interact with keyboard events
    1146                 if (on != null && !(on instanceof Text)) on = null;
     1153                if (on != null && !(on instanceof Text)) {
     1154                        on = null;
     1155                }
    11471156
    11481157                // DisplayIO.UpdateTitle();
     
    12061215        public static Text insertCharacterAction(Text text, boolean isShiftDown, final char c)
    12071216        {
    1208                 float oldY = DisplayController.getFloatMouseY();
     1217                final float oldY = DisplayController.getFloatMouseY();
     1218                final float oldX = DisplayController.getFloatMouseX();
     1219                System.err.println("insertCharacterAction: Prior to inserting character mouse at: " + oldX + "," + oldY);
    12091220                Point newMouse = null;
    12101221                if (c == '\t') {
    12111222                        if (isShiftDown) {
    1212                                 newMouse = text.removeTab(c, DisplayController.getFloatMouseX(), DisplayController.getFloatMouseY());
     1223                                newMouse = text.removeTab(c, oldX, oldY);
    12131224                        } else {
    1214                                 newMouse = text.insertTab(c, DisplayController.getFloatMouseX(), DisplayController.getFloatMouseY());
     1225                                newMouse = text.insertTab(c, oldX, oldY);
    12151226                        }
    12161227                } else {
    1217                         newMouse = text.insertChar(c, DisplayController.getFloatMouseX(), DisplayController.getFloatMouseY());
     1228                        newMouse = text.insertChar(c, oldX, DisplayController.getFloatMouseY());
    12181229                }
    12191230               
Note: See TracChangeset for help on using the changeset viewer.