28 | | ^(Describe your design here.)^ |
| 28 | |
| 29 | == Mouse click navigation == |
| 30 | |
| 31 | Mouse click navigation logic is going to be placed in the event handling method of the '''HotTextPlaceLogic''' class. |
| 32 | |
| 33 | It is going to use the modified '''getHitPos()''' method present in '''HotTextLayout''' for calculating the closest character position to the mouse click position (in relative coordinates). |
| 34 | The method finds the line (area) of text, that collides with the mouse position, then iterates trough the character positions in the line to find the one closest (so in the case there are no characters near the horizontal mouse coordinate, the caret will be placed after the last character of the line). |
| 35 | The caret position will also have additional calculations to correct the specific case when the user clicks near the middle of a character (in other words, the mouse arrow collides with the character): |
| 36 | [[BR]][[BR]][[Image(mousepoint.PNG)]][[BR]][[BR]] |
| 37 | Red is the mouse click position, blue is where the caret will be placed after the calculation. |
| 38 | |
| 39 | |
| 40 | == Up/Down arrow navigation == |
| 41 | |
| 42 | Design is still in the making. |