Closed lsdsjy closed 2 years ago
Hi @lsdsjy, to some degree, it is a feature. When using the marquee tool, only atoms (not the molecule) are selected and moved. Therefore the coordinates of atoms are changed but the coordinate of molecule is retained. However, if the molecule itself is selected (from the structure tree or by the select molecule tool) and moved, the coordinates of molecule will surely be modified.
@partridgejiang thanks for your reply but I tried both selecting from the structure tree and selecting by select molecule tool, it still doesn't work. (FYI, I used https://partridgejiang.github.io/Kekule.js/demos/items/chemEditor/chemEditor.html for experiments.)
Sorry I have made a mistake... the actual objects changing coordinates when moving are determined by getCoordDependentObjects
method of object. To an instance of Molecule
, this method returns its child atoms. So the coordinate of molecule will not change in normal manipulations of editor.
I see... so maybe I should use the child atoms to calculate the actual position of the molecule object. Thanks!
As posted below, a molecule is moved using marquee manipulate tool(also tried other manipulation tools), its descendants' absCoord2D are correct, but its own absCoord2D property is not updated correspondingly. Is it a feature or a bug?
![molecule](https://user-images.githubusercontent.com/1356263/128683409-b3895305-c2c4-48a1-8e45-7e2c7f6f68a6.png)