From ccf7f5e65f6fb941a56c62634dd4990c968e3379 Mon Sep 17 00:00:00 2001 From: Valentin Iorgu Date: Tue, 20 Feb 2024 12:06:09 +0200 Subject: [PATCH] Account for scale when updating the gutter height (#63) FIX: Fix a bug that caused the gutter to have the wrong height when the editor was scaled after construction. --- src/gutter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gutter.ts b/src/gutter.ts index 6746c75..375c1e6 100644 --- a/src/gutter.ts +++ b/src/gutter.ts @@ -146,7 +146,9 @@ const gutterView = ViewPlugin.fromClass(class { let vpOverlap = Math.min(vpA.to, vpB.to) - Math.max(vpA.from, vpB.from) this.syncGutters(vpOverlap < (vpB.to - vpB.from) * 0.8) } - if (update.geometryChanged) this.dom.style.minHeight = this.view.contentHeight + "px" + if (update.geometryChanged) { + this.dom.style.minHeight = (this.view.contentHeight / this.view.scaleY) + "px" + } if (this.view.state.facet(unfixGutters) != !this.fixed) { this.fixed = !this.fixed this.dom.style.position = this.fixed ? "sticky" : ""