Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the coordinates have a centroid that is far from zero, the molecule placed far offscreen. #1864

Closed
Zhirnoff opened this issue Nov 22, 2022 · 0 comments · Fixed by #1901
Closed
Assignees
Labels
Milestone

Comments

@Zhirnoff
Copy link
Collaborator

Zhirnoff commented Nov 22, 2022

Steps to Reproduce

  1. Open Ketcher
  2. Open browser console
  3. Paste into console:
    await ketcher.setMolecule(`
    Mrv2118 11202219232D

0 0 0 0 0 999 V3000
M V30 BEGIN CTAB
M V30 COUNTS 8 8 0 0 0
M V30 BEGIN ATOM
M V30 1 C 51.8392 -54.8062 0 0
M V30 2 C 51.8392 -53.2662 0 0
M V30 3 N 53.1738 -55.5762 0 0
M V30 4 C 54.5074 -54.8062 0 0
M V30 5 C 54.5074 -53.2662 0 0 CFG=1
M V30 6 O 53.1738 -52.4962 0 0
M V30 7 N 55.841 -55.5762 0 0
M V30 8 C 55.8411 -52.4962 0 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 1 1 2
M V30 2 1 1 3
M V30 3 1 6 2
M V30 4 2 3 4
M V30 5 1 4 5
M V30 6 1 4 7
M V30 7 1 5 6
M V30 8 1 5 8 CFG=1
M V30 END BOND
M V30 BEGIN COLLECTION
M V30 MDLV30/STEREL1 ATOMS=(1 5)
M V30 END COLLECTION
M V30 END CTAB
M END
`)
4. Look at canvas

Actual behavior
The molecule placed far offscreen. It is necessary to scroll a long way in order to see it or make 'Zoom out'

Expected behavior
After 'setMolecule' is called, the coordinates are normalised and the molecule is displayed iin the visible area of the canvas.

Screenshots
2022-11-22_17h01_45

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 107.0.5304.107 (Official Build) (64-bit)

Ketcher version
[Version 2.6.2]
Build at 2022-11-17; 13:01:16

@Zhirnoff Zhirnoff added the bug label Nov 22, 2022
@Zhirnoff Zhirnoff added this to the Release 2.7.0 milestone Nov 22, 2022
@Zhirnoff Zhirnoff changed the title If the coordinates have a centroid that is far from zero, the molecule can be placed far offscreen. If the coordinates have a centroid that is far from zero, the molecule placed far offscreen. Nov 22, 2022
@Nitvex Nitvex modified the milestones: Release 2.7.0, Release 2.8.0 Nov 24, 2022
@Nitvex Nitvex assigned porcelain11 and unassigned Nitvex Dec 1, 2022
porcelain11 added a commit that referenced this issue Dec 7, 2022
porcelain11 added a commit that referenced this issue Dec 7, 2022
@porcelain11 porcelain11 linked a pull request Dec 7, 2022 that will close this issue
porcelain11 added a commit that referenced this issue Dec 9, 2022
porcelain11 added a commit that referenced this issue Dec 12, 2022
porcelain11 added a commit that referenced this issue Dec 12, 2022
@Nitvex Nitvex modified the milestones: Release 2.8.0, Release 2.7.0 Dec 14, 2022
@Nitvex Nitvex added the rc.2 label Dec 14, 2022
Nitvex pushed a commit that referenced this issue Dec 14, 2022
…olecule placed far offscreen (#1901)

* #1864 refactor Render class

* #1864 Update setScrollOffset method

* #1864 Small fixes on comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants