Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(svg-editor): rubber band rework + Escape guard

WodenJay309a2e949878
diff --git a/skills/ppt-master/scripts/svg_editor/static/app.js b/skills/ppt-master/scripts/svg_editor/static/app.js
index 87a98c01..be663056 100644
--- a/skills/ppt-master/scripts/svg_editor/static/app.js
+++ b/skills/ppt-master/scripts/svg_editor/static/app.js
@@ -237,18 +237,12 @@
// Only left mouse button
if (e.button !== 0) return;
- // If clicking on a leaf SVG element (has a selectable ancestor that isn't
- // the SVG root), let its click handler deal with selection.
- var svg = svgContent.querySelector("svg");
- var selectable = e.target.closest ? e.target.closest(".svg-selectable") : null;
- if (selectable && selectable !== svg) {
- return;
- }
-
- // Starting rubber band on empty space or SVG background
+ // Always start tracking — rubber band only activates when
+ // mousemove exceeds the threshold. This allows clicking on any
+ // element (including SVG background rects) to still trigger
+ // the element's click handler for selection.
rubberBandStart = { x: e.clientX, y: e.clientY };
rubberBandUsed = false;
- overlay.classList.add("active");
});
document.addEventListener("mousemove", function (e) {
@@ -261,6 +255,12 @@
return;
}
+ // Threshold exceeded — this is a drag, not a click
+ if (!rubberBandUsed) {
+ rubberBandUsed = true;
+ overlay.classList.add("active");
+ }
+
if (!rubberBandEl) {
rubberBandEl = document.createElement("div");
rubberBandEl.id = "rubber-band";
@@ -293,7 +293,6 @@
// Only process if drag was beyond threshold
if (Math.abs(dx) >= RUBBER_BAND_THRESHOLD || Math.abs(dy) >= RUBBER_BAND_THRESHOLD) {
- rubberBandUsed = true;
var rect = {
left: Math.min(rubberBandStart.x, e.clientX),
top: Math.min(rubberBandStart.y, e.clientY),
@@ -395,8 +394,9 @@
updateSelectionPanel();
}
- // Escape: clear selection
+ // Escape: clear selection (skip if textarea is focused)
if (e.key === "Escape") {
+ if (document.activeElement === annotationText) return;
clearSelection();
}
});
diff --git a/skills/ppt-master/scripts/svg_editor/static/style.css b/skills/ppt-master/scripts/svg_editor/static/style.css
index d70fd246..bf6d4497 100644
--- a/skills/ppt-master/scripts/svg_editor/static/style.css
+++ b/skills/ppt-master/scripts/svg_editor/static/style.css
@@ -555,8 +555,8 @@ html, body {
#rubber-band {
position: fixed;
- border: 1px solid #4a9eff;
- background: rgba(74, 158, 255, 0.12);
+ border: 2px dashed #4a9eff;
+ background: rgba(74, 158, 255, 0.15);
pointer-events: none;
z-index: 11;
}