Skip to content

#5583 - Keep the current render options when editor.options() applies… - #11922

Open
mariam-khutuashvili wants to merge 2 commits into
masterfrom
5583-incorrect-selection-display-when-using-ketcher-editor-options-api
Open

mariam-khutuashvili wants to merge 2 commits into
masterfrom
5583-incorrect-selection-display-when-using-ketcher-editor-options-api

Conversation

@mariam-khutuashvili

@mariam-khutuashvili mariam-khutuashvili commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

editor.options(value) rebuilt the render with only { microModeScale, ...value }, so every setting not passed in the call was lost — bondThickness, bondSpacing, stereoBondWidth, fontsz and all the derived …InPx values. ReBond.getSelectionPoints then computed bondSpacingInPx + bondThickness as NaN and every selection plate collapsed onto the canvas origin, which is the streaks in the videos. Any key triggers it, viewOnlyMode included.

  • options() now merges the new values onto the current resolved render options, the same way setOptions() already does through Render.updateOptions. Merging from the resolved options (not the raw constructor options) keeps whatever a previous ketcher.setSettings() applied.
  • No behaviour change for the in-app callers (Settings changes and the template dialog pass full option objects).
  • Unit tests added for the merge, the explicit override and zoom preservation.

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect selection display when using ketcher.editor.options API

1 participant