Changes between Initial Version and Version 1 of Ticket #7888, comment 19
- Timestamp:
- 2012-08-04T22:11:53+02:00 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #7888, comment 19
initial v1 1 1 Replying to [comment:16 akks]: 2 2 > I am trying to understand all SelectAction code, especially modificator-related on my Windows. 3 > 3 4 Some parts of the JOSM code I try not to look at for too long, because it makes my eyes bleed. SelectAction is one of them. But you are trying to improve the situation, so I'll try to help the best I can. 5 4 6 > I have some questions, can someone who wrote the code (or know it well) help? 5 7 > … … 21 23 > 22 24 > What is the logic and purpose of such strange action? 23 > 25 26 I think it is due to the history of the code: The alt cycle behaviour was added by Christian Müller in Sep.-Oct. 2010. Scaling was implemented 2 Months later ([3702]) by Olivier Croquette. Probably the second author didn't bother to rework that part of the code. 27 24 28 > * We have two "dangerous" lines in code that change modificator flags: 25 29 > {{{ 26 30 > #!java 27 31 > alt = alt || Main.pref.getBoolean("selectaction.cycles.multiple.matches", false); 28 > ... 32 > }}} 33 34 Christian suggested, that "false" should be replaced by "true" after a testing period, but it did not happen so far. 35 36 > {{{ 37 > #!java 29 38 > shift |= getCurrentDataSet().getSelected().containsAll(prims); 30 39 > }}} 31 > http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java#L845 32 > http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java#L774 33 > 34 > (after next call of updateKeyModfiers '''alt''' and '''shift''' will be rewritten anyway, but before that happen, changed variable is used) 35 > Is there any purpose or we can just add some temporary variable instead of alt? 36 > 40 41 I would try to understand the purpose of this line and change it to a local variable unless there's a real semantic difference. 42


