Function: artist-straight-calculate-length

artist-straight-calculate-length is a byte-compiled function defined in artist.el.gz.

Signature

(artist-straight-calculate-length DIRECTION X1 Y1 X2 Y2)

Documentation

Calculate length for a straight line in DIRECTION from X1,Y1 to X2,Y2.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/artist.el.gz
(defun artist-straight-calculate-length (direction x1 y1 x2 y2)
  "Calculate length for a straight line in DIRECTION from X1,Y1 to X2,Y2."
  (cond ((or (= direction 7)
	     (= direction 0)
	     (= direction 1)) (1+ (- x2 x1)))
	((or (= direction 3)
	     (= direction 4)
	     (= direction 5)) (1+ (- x1 x2)))
	(t (1+ (abs (- y2 y1))))))