epam / ketcher

Web-based molecule sketcher
https://lifescience.opensource.epam.com/ketcher/demo.html
Apache License 2.0
485 stars 165 forks source link

Structures shift to center of canvas when enabling viewOnlyMode through the API #5502

Open Zhirnoff opened 1 month ago

Zhirnoff commented 1 month ago

Description: When using the API call window.ketcher.editor.setOptions(JSON.stringify({ viewOnlyMode: true })), structures already present on canvas are unexpectedly moved to the center, as if a layout function is being applied. This behavior is unintended and disrupts the original positioning of structures.

Steps to Reproduce:

1) Add any structures onto the canvas. 2) Use the following API call: window.ketcher.editor.setOptions(JSON.stringify({ viewOnlyMode: true })). 3) Observe the position of the structures on the canvas.

Actual Result: The structures shift to center of the canvas, behaving as though a layout is being applied.

Expected Result: The structures should remain in their original position without any movement or layout changes.

Screenshots

https://github.com/user-attachments/assets/73bc2eb1-0619-4e34-bbf0-7542645001fd

Desktop:

Ketcher version [Version 2.25.0-rc.1] Indigo version [Version 1.24.0-rc.1]

Bug found during testing: https://github.com/epam/ketcher/issues/4965

ivanmaslow commented 1 month ago

The issue isn't related to new changes in https://github.com/epam/ketcher/issues/4965