diff --git a/modules/analyze/html/custom.js b/modules/analyze/html/custom.js
index dd86734..550f989 100644
--- a/modules/analyze/html/custom.js
+++ b/modules/analyze/html/custom.js
@@ -154,6 +154,8 @@ function newwindow(id, title, content, height, width) {
// translate when resizing from top or left edges
x += event.deltaRect.left
y += event.deltaRect.top
+ x = Math.max(0, x)
+ y = Math.max(0, y)
target.style.transform = 'translate(' + x + 'px,' + y + 'px)'