diff --git a/lib/minimap-element.coffee b/lib/minimap-element.coffee index bd56c5b2..fd0ee8d9 100644 --- a/lib/minimap-element.coffee +++ b/lib/minimap-element.coffee @@ -41,13 +41,12 @@ class MinimapElement extends HTMLElement @shadowRoot.appendChild(@visibleArea) measureHeightAndWidth: -> - editorElement = @getTextEditorElement() - width = @clientWidth - height = @clientHeight + @width = @clientWidth + @height = @clientHeight - if width isnt @canvas.width or height isnt @canvas.height - @canvas.width = width * devicePixelRatio - @canvas.height = height * devicePixelRatio + if @width isnt @canvas.width or @height isnt @canvas.height + @canvas.width = @width * devicePixelRatio + @canvas.height = (@height + @minimap.getLineHeight()) * devicePixelRatio getTextEditor: -> @minimap.getTextEditor() diff --git a/spec/minimap-element-spec.coffee b/spec/minimap-element-spec.coffee index f9fa9247..59b3ee1b 100644 --- a/spec/minimap-element-spec.coffee +++ b/spec/minimap-element-spec.coffee @@ -93,7 +93,7 @@ describe 'MinimapElement', -> expect(minimapElement.offsetWidth).toBeCloseTo(editorElement.clientWidth / 10, -1) it 'resizes the canvas to fit the minimap', -> - expect(canvas.offsetHeight).toEqual(minimapElement.offsetHeight) + expect(canvas.offsetHeight).toEqual(minimapElement.offsetHeight + minimap.getLineHeight()) expect(canvas.offsetWidth).toEqual(minimapElement.offsetWidth) it 'requests an update', ->