Position of Shapes and Text are changed after Layout action
- Dominant language
- C++
- Stars
- 406
- Forks
- 134
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 24
Description
**Steps to Reproduce**
1. Open from KET file one corrupted elements with shapes and text:
[defect.zip](https://github.com/user-attachments/files/16512478/defect.zip)
2. Add to Canvas:

3. Click on Layout action
**Expected behavior**
- Chemical elements are fixed and aligned, shapes and text are moved according to position of new center of mass of chemical elements
- What should be done: Calculate center of mass of chemical elements (red cross). Layout is applied. Chemical elements are fixed and aligned. Simple objects are moved according to new center of mass of chemistry objects (blue cross).
There is an example with different objects from @vanoprenko:

**Actual behavior**
- Elements are fixed, but the elements are moved to the top left and shapes/text are moved to the bottom right and size of shapes is reduced

4. If the user clicks on Layout one more time or more
**Expected behavior**
- Elements and objects are on the same place
**Actual Behavior**
- Elements and shapes/text are shifted from each other even more (size of shapes is reduced more):

**Environment details:**
- Ketcher [Version 2.24.0-rc.3] Build at 2024-08-20; 13:16:59
- Indigo Version 1.23.0-rc.2.0-g6a2a7526a-wasm32-wasm-clang-19.0.0
- OS: Windows 11 Enterprise
- Browser: Chrome, Version 127.0.6533.100 (Official Build) (64-bit)
**Action item**:
- Need to automate this case after the fix.
**Additional context**
- Detected during preview tests for Image feature - https://github.com/epam/Indigo/issues/2144. This issue is reproducible for images as well, but the issue isn't introduced after Image changes. **The fix should be verified for images, shapes and text as well**.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.