···3333 translate: new TranslateTool(this),
3434 rotate: new RotateTool(this),
3535 };
3636- this.tool = this.tools.rotate;
3636+ this.tool = this.tools.translate;
37373838 this.props = props;
3939···62626363 uiElem.addEventListener("gotpointercapture", _ => uiElem.classList.add("active"));
6464 uiElem.addEventListener("lostpointercapture", _ => uiElem.classList.remove("active"));
6565+ props.addEventListener("input", this.readProperty.bind(this));
65666667 this.update();
6768 this.updateProperties();
···151152 this.tool.drawWidget(targets);
152153 }
153154155155+ // Read a property from the panel into object(s)
156156+ readProperty(e) {
157157+ let prop = e.target.closest(".prop");
158158+ if (!prop) {
159159+ return;
160160+ }
161161+ let value = this.getProperty(prop);
162162+ // TODO: Make a command.
163163+ let targets = this.selection;
164164+ targets.forEach((target) => {
165165+ target[prop.id] = value;
166166+ if (target.updatePath) target.updatePath();
167167+ target.updateGraph();
168168+ });
169169+ this.updateHighlights();
170170+ this.updateUI();
171171+ }
172172+173173+ // Update the properties panel to match the selected object(s)
154174 updateProperties() {
155175 // Set properties header.
156176 let header = props.querySelector("h2");
···185205 }
186206 }
187207208208+ // Update the properties panel to match one specific object, optionally merging with the properties that are already there.
188209 setProperties(srcObj, updateValues = true) {
189210 let srcProps = srcObj.constructor.optionKeys;
190211 let destProps = this.props.querySelectorAll(".prop");
···208229 });
209230 }
210231232232+ // Get the type of a property.
211233 getPropertyType(prop) {
212234 let types = ["vector", "number", "color", "bool"];
213235 for (let i = 0; i < types.length; i++) {
···218240 return null;
219241 }
220242243243+ // Set the value of a property in the properties panel.
221244 setProperty(srcObj, prop) {
222245 let type = this.getPropertyType(prop);
223246···260283 return "#000000";
261284 }
262285286286+ // Get the value of a property in the properties panel.
263287 getProperty(prop) {
264288 let type = this.getPropertyType(prop);
265289···481505 });
482506 this.editor.updateHighlights();
483507 this.editor.updateUI();
508508+ this.editor.updateProperties();
484509 }
485510 end(ptr, target, x, y) {
486511 if (!this.mode) { return; }
···599624 });
600625 this.editor.updateHighlights();
601626 this.editor.updateUI();
627627+ this.editor.updateProperties();
602628 }
603629 // TODO: Let's stash `delta` somewhere so we don't have to recalculate it in end()
604630 end( ptr, target, x, y ) {