     
     // Always indent textfield by a little bit
     curX += self.TEXT_FIELD_HSPACE
-    let textBoundary = isOnFirstLine ? firstLineRightBoundary : rightBoundary
+    let textBoundary = currentLine == 0 ? firstLineRightBoundary : rightBoundary
     var availableWidthForTextField = textBoundary - curX
     if (availableWidthForTextField < self.MINIMUM_TEXTFIELD_WIDTH) {
-      isOnFirstLine = false
       curX = self.PADDING_LEFT + self.TEXT_FIELD_HSPACE
       curY += self.STANDARD_ROW_HEIGHT+self.VERTICAL_SPACE_BETWEEN_ROWS
       // Adjust the width

    
    // Position token views
    var tokenRect = CGRect.null
    for view in self.tokenViews {
      view.sizeToFit()
      tokenRect = view.frame
      
      let tokenBoundary = isOnFirstLine ? firstLineRightBoundary : rightBoundary
      if (curX + tokenRect.width > tokenBoundary) {
        // Need a new line
        curX = self.PADDING_LEFT
        curY += self.STANDARD_ROW_HEIGHT+self.VERTICAL_SPACE_BETWEEN_ROWS
        isOnFirstLine = false
      }
      
      tokenRect.origin.x = curX
      // Center our tokenView vertially within STANDARD_ROW_HEIGHT

    
    var curX = self.PADDING_LEFT
    var curY = self.PADDING_TOP
    var yPositionForLastToken: CGFloat = 0.0
    
    // Position field view (if set)
