Skip to content

Commit

Permalink
Account for scale when updating the gutter height (#63)
Browse files Browse the repository at this point in the history
FIX: Fix a bug that caused the gutter to have the wrong height when the editor was scaled after construction.
  • Loading branch information
viorgu committed Feb 20, 2024
1 parent fc1d11f commit ccf7f5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gutter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" : ""
Expand Down

0 comments on commit ccf7f5e

Please sign in to comment.