From ea07cd89dee6d34198e99e9d4c19ead4cb2e4a2e Mon Sep 17 00:00:00 2001 From: dsehnal Date: Sun, 21 Dec 2025 16:15:56 +0100 Subject: [PATCH] better canvas background handling --- CHANGELOG.md | 2 ++ breaking-v6-changes.md | 1 + src/apps/viewer/app.ts | 3 +++ src/apps/viewer/mvs.html | 16 +++++++----- src/mol-canvas3d/canvas3d.ts | 26 +++++++++++++++++++ .../skin/base/components/viewport.scss | 21 --------------- src/mol-plugin/container.ts | 13 ++++------ src/mol-plugin/context.ts | 5 +++- 8 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 breaking-v6-changes.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 19eba34c6..d4ea0fc44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ Note that since we don't clearly distinguish between a public and private interf - Fix `flipSided` for meshes - Add `label/auth_comp_id` to `StructureProperties.residue` - Previously, this has been only been present on `.atom` (since residue name can alter on per-atom basis), but this has been a bit confusing for the general use-case +- Move canvas "checked background" logic to `canvas3d.ts` and only apply it when `transparentBackground` is on + - This prevents an ugly flicked during plugin initialization ## [v5.4.2] - 2025-12-07 - Fix postprocessing issues with SSAO and outlines for large structures (#1387) diff --git a/breaking-v6-changes.md b/breaking-v6-changes.md new file mode 100644 index 000000000..7b469d9e0 --- /dev/null +++ b/breaking-v6-changes.md @@ -0,0 +1 @@ +- Remove `checkeredCanvasBackground` from `PluginContext` and `PluginContainer` \ No newline at end of file diff --git a/src/apps/viewer/app.ts b/src/apps/viewer/app.ts index 50067d974..cd3b15b9b 100644 --- a/src/apps/viewer/app.ts +++ b/src/apps/viewer/app.ts @@ -83,6 +83,9 @@ export class Viewer { } const spec: PluginUISpec = { + canvas3d: { + ...defaultSpec.canvas3d, + }, actions: defaultSpec.actions, behaviors: [ ...baseBehaviors, diff --git a/src/apps/viewer/mvs.html b/src/apps/viewer/mvs.html index bf997ae67..e6a798d01 100644 --- a/src/apps/viewer/mvs.html +++ b/src/apps/viewer/mvs.html @@ -6,12 +6,16 @@ Mol* Viewer MolViewSpec Example