code: func borderOptimize(cmd *command.Command, cmds []command.Command, idx int) (ok bool, border int) {
  	if idx >= len(cmds) {
  		return false, 0
  	}
  
  	if cmd.Kind != command.RectFilledCmd || cmds[idx].Kind != command.RectFilledCmd {
  		return false, 0
  	}
  
  	cmd2 := cmds[idx]
  
  	if cmd.RectFilled.Color.A != 0xff && cmd2.RectFilled.Color.A != 0xff {
  		return false, 0
  	}
  
  	border = cmd2.X - cmd.X
  	if border <= 0 || border > 128 {
  		return false, 0
  	}
  
  	if shrinkRect(cmd.Rect, border) != cmd2.Rect {
  		return false, 0
  	}
  
  	return true, border
  }
docs: // Returns true if cmds[idx] is a shrunk version of CommandFillRect and its
  // color is not semitransparent and the border isn't greater than 128