Closed yjung closed 11 years ago
Regarding your comment "?!?" in line 518 of PrimitiveManager.js:
If I understood you correctly, we always need to ensure that a primitive is not highlighted before hightlighting it, because otherwise its actual color might get lost. Therefore it is done like this:
trafo.highlight(false, highlightCol); trafo.highlight(true, highlightCol);
The if-else-construct in line 555 and following was there because of the "todo" remark above - currently, both of the classes "group" and "primitive" have an own method "getDOMNode", but is is not a method of the base class and therefore not the same function (could also have 2 different names). The todo and the branch were meant to one remind of this issue, which needs to be resolved.
Ok, then the todo remark was only an "insider" todo...
Concerning highlighting: just de-highlighting everything before highlighting something is a bit brute force, theoretically the state should correspond to the selected property and therefore one knows if it is highlighted or not, but anyway...
Okay, so I can "select" something, apart from highlighting it? Is this done via setAttribute("selected", state)? What is the clean way of doing it?
No, I just meant that in the editor code you know (by means of the application logic) which object is the current - and thereby selected - one. Given this, highlighting could be implemented a bit smarter, though for this demonstrator it is not very important to do so.
Dynamic grid size update missing