Function: artist-pen-set-arrow-points

artist-pen-set-arrow-points is a byte-compiled function defined in artist.el.gz.

Signature

(artist-pen-set-arrow-points X1 Y1)

Documentation

Set arrow points for pen drawing using X1, Y1.

Also, the artist-key-poly-point-list is reversed.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/artist.el.gz
(defun artist-pen-set-arrow-points (_x1 _y1)
  "Set arrow points for pen drawing using X1, Y1.
Also, the `artist-key-poly-point-list' is reversed."

  (setq artist-key-poly-point-list
        (seq-uniq artist-key-poly-point-list))

  (if (>= (length artist-key-poly-point-list) 2)

      ;; Only set arrow-points if the point-list has two or more entries
      (let ((xn   (car (car artist-key-poly-point-list)))
	    (yn   (cdr (car artist-key-poly-point-list)))
	    (xn-1 (car (car (cdr artist-key-poly-point-list))))
	    (yn-1 (cdr (car (cdr artist-key-poly-point-list))))
	    (dirn))			; direction for point n
	(setq artist-key-poly-point-list (reverse artist-key-poly-point-list))
	(let ((x0 (car (car artist-key-poly-point-list)))
	      (y0 (cdr (car artist-key-poly-point-list)))
	      (x1 (car (car (cdr artist-key-poly-point-list))))
	      (y1 (cdr (car (cdr artist-key-poly-point-list))))
	      (dir0))			; direction for point 0
	  (setq dir0 (artist-find-direction x1 y1 x0 y0))
	  (setq dirn (artist-find-direction xn-1 yn-1 xn yn))
	  (setq artist-arrow-point-1 (artist-make-arrow-point x0 y0 dir0))
	  (setq artist-arrow-point-2 (artist-make-arrow-point xn yn dirn))))))