From 4dd9b04bd95f6b1651022d4225dc44241adb9dc9 Mon Sep 17 00:00:00 2001 From: Jack Gallant Date: Mon, 1 Jun 2026 11:16:18 -0700 Subject: [PATCH] Revert "webgl: fix ROI/sulci/label overlay toggles racing the texture bake (#643)" This reverts commit 2c64b0bd063964fc1c7bc9a4275e99a67bddd624. --- cortex/webgl/resources/js/svgoverlay.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cortex/webgl/resources/js/svgoverlay.js b/cortex/webgl/resources/js/svgoverlay.js index bcf951a28..db33a0367 100644 --- a/cortex/webgl/resources/js/svgoverlay.js +++ b/cortex/webgl/resources/js/svgoverlay.js @@ -114,17 +114,11 @@ var svgoverlay = (function(module) { this.svg.setAttribute("height", this.height); }, module.SVGOverlay.prototype.update = function() { - // Re-bake the SVG overlay into a GPU texture asynchronously (toDataURL -> Image.onload). - // Rapid layer toggles (ROIs / sulci / labels) can kick off several bakes that finish out - // of order, leaving a stale texture on the surface that disagrees with the switch state. - // Tag each bake with a generation id and commit only the most recent one. - var gen = (this._updateGen = (this._updateGen || 0) + 1); + console.log("Updating overlay!"); this.svg.toDataURL("image/png", {renderer:"native", callback:function(dataurl) { var img = new Image(); //img.src = dataurl; img.onload = function () { - if (gen !== this._updateGen) - return; // superseded by a newer toggle -- discard this stale bake var tex = new THREE.Texture(img); tex.needsUpdate = true; //tex.anisotropy = 16;