diff --git a/lib/minimap-element.js b/lib/minimap-element.js index 7a8e3156..47dad2da 100644 --- a/lib/minimap-element.js +++ b/lib/minimap-element.js @@ -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; } + ` } } @@ -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) } }