Function: artist-draw-rect

artist-draw-rect is a byte-compiled function defined in artist.el.gz.

Signature

(artist-draw-rect X1 Y1 X2 Y2)

Documentation

Draw a rectangle with corners at X1, Y1 and X2, Y2.

Output is a rectangle, which is a list on the form
(END-POINT-1 END-POINT-2 SHAPE-INFO).

END-POINT-1 and END-POINT-2 are two-element vectors on the form [X Y]. SHAPE-INFO is a list of four straight lines.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/artist.el.gz
;;
;; Drawing and undrawing rectangles and squares
;;

(defun artist-draw-rect (x1 y1 x2 y2)
  "Draw a rectangle with corners at X1, Y1 and X2, Y2.

Output is a rectangle, which is a list on the form
\(END-POINT-1 END-POINT-2 SHAPE-INFO).

END-POINT-1 and END-POINT-2 are two-element vectors on the form [X Y].
SHAPE-INFO is a list of four straight lines."
  (let* ((artist-line-char (artist-compute-line-char))
         (artist-line-char-set artist-line-char)
         (line1 (artist-draw-sline x1 y1 x2 y1))
	 (line2 (artist-draw-sline x2 y1 x2 y2))
	 (line3 (artist-draw-sline x2 y2 x1 y2))
	 (line4 (artist-draw-sline x1 y2 x1 y1))
	 (endpoint1 (artist-make-endpoint x1 y1))
	 (endpoint2 (artist-make-endpoint x2 y2)))
    (artist-make-2point-object endpoint1
			       endpoint2
			       (list line1 line2 line3 line4))))