     resizeBlockMode: ->
       @resizeTextMode()
 
-      @dropletElement.style.height = "#{@wrapperElement.offsetHeight}px"
+      @dropletElement.style.height = "#{@wrapperElement.clientHeight}px"
       if @paletteEnabled
         @dropletElement.style.left = "#{@paletteElement.offsetWidth}px"
-        @dropletElement.style.width = "#{@wrapperElement.offsetWidth - @paletteWrapper.offsetWidth}px"
+        @dropletElement.style.width = "#{@wrapperElement.clientWidth - @paletteWrapper.offsetWidth}px"
       else
         @dropletElement.style.left = "0px"
-        @dropletElement.style.width = "#{@wrapperElement.offsetWidth}px"
+        @dropletElement.style.width = "#{@wrapperElement.clientWidth}px"
 
       @resizeGutter()
 

      setTimeout (=>
        # Hide scrollbars and increase width
        @mainScroller.style.overflow = 'hidden'
        @dropletElement.style.width = @wrapperElement.offsetWidth + 'px'

        @redrawMain noText: true


          @redrawTextInput()

  Editor::resizeAceElement = ->
    width = @wrapperElement.clientWidth
    if @showPaletteInTextMode and @paletteEnabled
      width -= @paletteElement.offsetWidth

    @aceElement.style.width = "#{width}px"
    @aceElement.style.height = "#{@wrapperElement.clientHeight}px"

  last_ = (array) -> array[array.length - 1]

