code: func (f *Frame) Draw(screen tcell.Screen) {
  	f.Box.Draw(screen)
  
  	// Calculate start positions.
  	x, top, width, height := f.GetInnerRect()
  	bottom := top + height - 1
  	x += f.left
  	top += f.top
  	bottom -= f.bottom
  	width -= f.left + f.right
  	if width <= 0 || top >= bottom {
  		return // No space left.
  	}
  
  	// Draw text.
  	var rows [6]int // top-left, top-center, top-right, bottom-left, bottom-center, bottom-right.
  	topMax := top
  	bottomMin := bottom
  	for _, text := range f.text {
  		// Where do we place this text?
  		var y int
  		if text.Header {
  			y = top + rows[text.Align]
  			rows[text.Align]++
  			if y >= bottomMin {
  				continue
  			}
  			if y+1 > topMax {
  				topMax = y + 1
  			}
  		} else {
  			y = bottom - rows[3+text.Align]
  			rows[3+text.Align]++
  			if y <= topMax {
  				continue
  			}
  			if y-1 < bottomMin {
  				bottomMin = y - 1
  			}
  		}
  
  		// Draw text.
  		Print(screen, text.Text, x, y, width, text.Align, text.Color)
  	}
  
  	// Set the size of the contained primitive.
  	if topMax > top {
  		top = topMax + f.header
  	}
  	if bottomMin < bottom {
  		bottom = bottomMin - f.footer
  	}
  	if top > bottom {
  		return // No space for the primitive.
  	}
  	f.primitive.SetRect(x, top, width, bottom+1-top)
  
  	// Finally, draw the contained primitive.
  	f.primitive.Draw(screen)
  }
docs: // Draw draws this primitive onto the screen.