Function: artist-fill-square

artist-fill-square is a byte-compiled function defined in artist.el.gz.

Signature

(artist-fill-square SQUARE X1 Y1 X2 Y2)

Documentation

Fill a SQUARE from X1,Y1 to X2,Y2.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/artist.el.gz
(defun artist-fill-square (_square x1 y1 x2 y2)
  "Fill a SQUARE from X1,Y1 to X2,Y2."
  (let* ((square-corners (artist-rect-corners-squarify x1 y1 x2 y2))
	 (new-x1 (elt square-corners 0))
	 (new-y1 (elt square-corners 1))
	 (new-x2 (elt square-corners 2))
	 (new-y2 (elt square-corners 3))
	 (x (1+ (min new-x1 new-x2)))
	 (y (1+ (min new-y1 new-y2)))
	 (x-max (max new-x1 new-x2))
	 (y-max (max new-y1 new-y2))
	 (w (- x-max x)))
    (while (< y y-max)
      (artist-move-to-xy x y)
      (artist-replace-chars artist-fill-char w)
      (setq y (1+ y)))))