;================================================================================ ; Robert Johnstone ; Simon Fraser University ; ; Last Modified: 2000/08/14 ; ; Copyright 2000 Robert W. Johnstone ;-------------------------------------------------------------------------------- ; This procedure is used to create a "rounded" rectangle. The corners are not ; actually rounded, by have a specified chamfer. If the chamfer is zero, this ; produces a regular rectangle. Chamfers of less than zero are invalid. ; ; If x1>x2, or y1>y2, then this routine will not work properly. ; ; layer: name of the drawing layer ; c: chamfer ; x1,y1: coordinates of the lower-left corner ; x2,y2: coordinates of the upper-right corner procedure( rodCreateRoundRect( layer c x1 y1 x2 y2 ) if( (c>0) rodCreatePolygon( ?layer layer ?pts list( (x1+c):y1 x1:(y1+c) x1:(y2-c) (x1+c):y2 (x2-c):y2 x2:(y2-c) x2:(y1+c) (x2-c):y1 ) ) rodCreateRect( ?layer layer ?bBox list( x1:y1 x2:y2 ) ) ) )