code: func (self line) draw(cell Cell, buf *Buffer) {
  	isLeftOf := func(p1, p2 image.Point) bool {
  		return p1.X <= p2.X
  	}
  	isTopOf := func(p1, p2 image.Point) bool {
  		return p1.Y <= p2.Y
  	}
  	p1, p2 := self.P1, self.P2
  	buf.SetCell(NewCell('*', cell.Style), self.P2)
  	width, height := self.size()
  	if width > height { // paint left to right
  		if !isLeftOf(p1, p2) {
  			p1, p2 = p2, p1
  		}
  		flip := 1.0
  		if !isTopOf(p1, p2) {
  			flip = -1.0
  		}
  		for x := p1.X; x <= p2.X; x++ {
  			ratio := float64(height) / float64(width)
  			factor := float64(x - p1.X)
  			y := ratio * factor * flip
  			buf.SetCell(cell, image.Pt(x, int(RoundFloat64(y))+p1.Y))
  		}
  	} else { // paint top to bottom
  		if !isTopOf(p1, p2) {
  			p1, p2 = p2, p1
  		}
  		flip := 1.0
  		if !isLeftOf(p1, p2) {
  			flip = -1.0
  		}
  		for y := p1.Y; y <= p2.Y; y++ {
  			ratio := float64(width) / float64(height)
  			factor := float64(y - p1.Y)
  			x := ratio * factor * flip
  			buf.SetCell(cell, image.Pt(int(RoundFloat64(x))+p1.X, y))
  		}
  	}
  }
docs: // draws the line