Skip to content

Commit

Permalink
🐛 Fix invalid overlay offset when minimap is not adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Oct 20, 2016
1 parent f57218d commit 73b9917
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions lib/minimap-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,12 @@ const removeOverlayStyle = () => {

const updateOverlayStyle = (basis) => {
if (overlayStyle) {
if (basis) {
overlayStyle.textContent = `
atom-text-editor[with-minimap]::shadow atom-overlay,
atom-text-editor[with-minimap] atom-overlay {
margin-left: ${basis};
}
`
} else {
overlayStyle.textContent = `
atom-text-editor[with-minimap]::shadow atom-overlay,
atom-text-editor[with-minimap] atom-overlay {
margin-left: 10%;
}
`
overlayStyle.textContent = `
atom-text-editor[with-minimap]::shadow atom-overlay,
atom-text-editor[with-minimap] atom-overlay {
margin-left: ${basis}px;
}
`
}
}

Expand Down Expand Up @@ -1003,18 +994,17 @@ export default class MinimapElement {
canvasWidth = width
updateOverlayStyle(width)
} else {
updateOverlayStyle(canvasWidth)
delete this.flexBasis
updateOverlayStyle()
}
} else {
updateOverlayStyle(canvasWidth)
delete this.flexBasis
updateOverlayStyle()
}

this.updateCanvasesSize(canvasWidth)
} else {
this.style.flexBasis = safeFlexBasis
updateOverlayStyle(safeFlexBasis)
}
}

Expand Down

0 comments on commit 73b9917

Please sign in to comment.