x3dom / apps-modeling

Publicly Available Applications
Other
3 stars 3 forks source link

Snap-to-grid broken #61

Closed yjung closed 11 years ago

yjung commented 11 years ago

Dynamic grid size update missing

mlimper commented 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.

yjung commented 11 years ago

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...

mlimper commented 11 years ago

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?

yjung commented 11 years ago

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.