From 11a0fa7a1246901810cbf3fcedc00739c94931c0 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 13 May 2015 11:39:28 +0200 Subject: [PATCH] updateTileSize on start --- spec/text-editor-presenter-spec.coffee | 18 ++++++++---------- src/text-editor-presenter.coffee | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/spec/text-editor-presenter-spec.coffee b/spec/text-editor-presenter-spec.coffee index 6db369f69..98c4caecb 100644 --- a/spec/text-editor-presenter-spec.coffee +++ b/spec/text-editor-presenter-spec.coffee @@ -658,28 +658,26 @@ describe "TextEditorPresenter", -> expect(presenter.getState().content.placeholderText).toBe "new-placeholder-text" describe ".tiles", -> - it "contains states for tiles that are visible on screen, plus and minus the overdraw margin", -> - presenter = buildPresenter(explicitHeight: 3, scrollTop: 1, lineHeight: 1, tileCount: 3, tileOverdrawMargin: 1) + fffit "contains states for tiles that are visible on screen", -> + presenter = buildPresenter(explicitHeight: 3, scrollTop: 1, lineHeight: 1, tileCount: 3) + console.log JSON.stringify(presenter.getState().content.tiles) expectValues presenter.getState().content.tiles[0], { - top: -1 - } - expectValues presenter.getState().content.tiles[1], { top: 0 } - expectValues presenter.getState().content.tiles[2], { + expectValues presenter.getState().content.tiles[1], { top: 1 } - expectValues presenter.getState().content.tiles[3], { + expectValues presenter.getState().content.tiles[2], { top: 2 } - expectValues presenter.getState().content.tiles[4], { + expectValues presenter.getState().content.tiles[3], { top: 3 } - expectValues presenter.getState().content.tiles[5], { + expectValues presenter.getState().content.tiles[4], { top: 4 } - expect(presenter.getState().content.tiles[6]).toBeUndefined() + expect(presenter.getState().content.tiles[5]).toBeUndefined() it "does not overdraw above the first row", -> presenter = buildPresenter(explicitHeight: 3, scrollTop: 0, lineHeight: 1, tileCount: 3, tileOverdrawMargin: 1) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index f5fb1257a..a8d845c72 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -223,6 +223,7 @@ class TextEditorPresenter @updateScrollbarDimensions() @updateStartRow() @updateEndRow() + @updateTileSize() @updateFocusedState() @updateHeightState()