;;;-*- Mode:Common-Lisp; Package:PICTURE; Base:10; Fonts:(MEDFNB HL12B HL12BI) -*-



;;; This software was developed at the Texas Instruments Corporation
;;; and is provided "as-is".  Texas Instruments Corporation and the
;;; author disclaim all warranties on the software, including without
;;; limitation, all implied warranties of merchantability and fitness.
;;;
;;; This software does not contain any technical data or information
;;; that is proprietary in nature.  It may be copied, modified, and
;;; distributed on a non-profit basis and with the inclusion of this
;;; notice.
;;;
;;; Copyright (C) 1989, Texas Instruments Incorporated.




;;; Change history:
;;;
;;;  Date      Author	Description
;;; -------------------------------------------------------------------------------------
;;;  5/04/88    TWE	Fixed a divide-by-zero error in SIMPLE-DRAW-CORNER.
;;;  6/22/87    TWE	Initial creation.

#|

This file contains code which is needed to draw corners and ovals.

|#

(DEFFLAVOR OVAL-OBJECT
  ((WIDTH  0.0 :TYPE FLOAT)
   (HEIGHT 0.0 :TYPE FLOAT))
 (BASIC-OBJECT)
  :INITTABLE-INSTANCE-VARIABLES
  :GETTABLE-INSTANCE-VARIABLES
  :SETTABLE-INSTANCE-VARIABLES)

(DEFUN SIMPLE-DRAW-CORNER (WINDOW X Y RADIUS CORNER &OPTIONAL (ALU W:ALU-IOR) (THICKNESS 1))
  (WHEN (NOT (ZEROP RADIUS))
    (LET ((X-START (CASE CORNER
                     (:NE (+ X RADIUS))
                     (:NW X)
                     (:SW (- X RADIUS))
                     (:SE X)))
          (Y-START (CASE CORNER
                     (:NE Y)
                     (:NW (- Y RADIUS))
                     (:SW Y)
                     (:SE (+ Y RADIUS)))))
      (SEND WINDOW :DRAW-ARC X Y X-START Y-START 90.0 THICKNESS W:BLACK ALU))))
