Function: artist-vaporize-by-endpoints

artist-vaporize-by-endpoints is a byte-compiled function defined in artist.el.gz.

Signature

(artist-vaporize-by-endpoints ENDPOINT1 ENDPOINT2)

Documentation

Given ENDPOINT1 and ENDPOINT2, vaporize the line between them.

An endpoint is a pair (X . Y).

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/artist.el.gz
(defun artist-vaporize-by-endpoints (endpoint1 endpoint2)
  "Given ENDPOINT1 and ENDPOINT2, vaporize the line between them.
An endpoint is a pair (X . Y)."
  (let* ((x1 (car endpoint1))
	 (y1 (cdr endpoint1))
	 (x2 (car endpoint2))
	 (y2 (cdr endpoint2))
	 (dir (artist-find-direction x1 y1 x2 y2))
	 (x-step (aref [1 1 0 -1 -1 -1 0 1] dir))
	 (y-step (aref [0 1 1 1 0 -1 -1 -1] dir))
	 (line-c (aref [?- ?\\ ?| ?/ ?- ?\\ ?| ?/] dir))
	 (line-len (elt (list (abs (- x2 x1))
			      (abs (- x2 x1))
			      (abs (- y2 y1))
			      (abs (- y2 y1))
			      (abs (- x1 x2))
			      (abs (- x1 x2))
			      (abs (- y1 y2))
			      (abs (- y1 y2)))
			dir))
	 (x x1)
	 (y y1))
    (while (>= line-len 0)
      (let* ((buffer-c (artist-get-char-at-xy-conv x y))
	     (new-c (artist-unintersection-char line-c buffer-c)))
	(artist-move-to-xy x y)
	(artist-replace-char new-c))
      (setq x (+ x x-step)
	    y (+ y y-step)
	    line-len (- line-len 1)))))