From 952ea553c746cce7462892574fce77911e4510fc Mon Sep 17 00:00:00 2001 From: Ladd Date: Sat, 27 Dec 2025 02:21:57 -0600 Subject: [PATCH] show vectors option --- tool/options.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tool/options.js b/tool/options.js index b601891..ef5ca69 100644 --- a/tool/options.js +++ b/tool/options.js @@ -1,7 +1,8 @@ // Options picker import { Tool } from '../tool.js'; import { - MODE_PAN_VIEW, + DISPLAY_ACCELERATION_VECTORS, + DISPLAY_VELOCITY_VECTORS, PAUSE_DURING_CREATION, PAUSE_DURING_SELECTION, } from '../config.js'; @@ -12,6 +13,11 @@ export class Options extends Tool { items: [ { type: 'boolean', name: 'creation', title: 'Creation', default: PAUSE_DURING_CREATION }, { type: 'boolean', name: 'selection', title: 'Selection', default: PAUSE_DURING_SELECTION }, + ]}, { + type: 'group', name: 'show', title: 'Show Vectors', + items: [ + { type: 'boolean', name: 'velocity', title: 'Velocity', default: DISPLAY_VELOCITY_VECTORS }, + { type: 'boolean', name: 'acceleration', title: 'Acceleration', default: DISPLAY_ACCELERATION_VECTORS }, ] }]; @@ -36,12 +42,11 @@ export class Options extends Tool { button.innerHTML = `

${item.title}

`; this.setOption(path, item.default); button.style.opacity = this.values[path] ? '100%' : '50%'; - button.addEventListener('click', (e) => { + button.addEventListener('click', () => { this.setOption(path, !this.getOption(path)); button.style.opacity = this.values[path] ? '100%' : '50%'; }); return button; - break; } default: throw new Error('unknown option type');