feat(biochem): surface 3D toggle button in molecular editor
3D rendering (toggle3D/render3D with VDW radii + sphere gradients) was implemented but had no visible Esc-key exit and cursor was left in 'grab' state when leaving 3D mode. Changes: - Esc key now exits 3D mode (toggle3D) in addition to cancel/close actions - cursor correctly resets to 'crosshair' on 3D exit and 'grab' on enter - btn-3d toolbar button confirmed visible with mode-3d-active active state Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1678,10 +1678,12 @@ function toggle3D() {
|
|||||||
vdwBtn.style.display = _is3D ? '' : 'none';
|
vdwBtn.style.display = _is3D ? '' : 'none';
|
||||||
if (!_is3D && _isVDW) { _isVDW = false; vdwBtn.classList.remove('mode-3d-active'); }
|
if (!_is3D && _isVDW) { _isVDW = false; vdwBtn.classList.remove('mode-3d-active'); }
|
||||||
if (_is3D) {
|
if (_is3D) {
|
||||||
|
canvas.style.cursor = 'grab';
|
||||||
centerView();
|
centerView();
|
||||||
_start3D();
|
_start3D();
|
||||||
} else {
|
} else {
|
||||||
_stop3D();
|
_stop3D();
|
||||||
|
canvas.style.cursor = 'crosshair';
|
||||||
render();
|
render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user