;================================================================================ ; Robert Johnstone ; Simon Fraser University ; ; Copyright 2000,2002 Robert W. Johnstone ;-------------------------------------------------------------------------------- ; 2002/06/03 ; - updated parameter list to conform with Cadence style ; 2000/08/14 ; - created ; 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. ; ; pcCellView: handle to cellview in which drawing is to take place ; layer: name of the drawing layer ; bBox: bounding box ; c: chamfer procedure( dbCreateRoundRect( pcCellView layer bBox c ) let( ; declare variables ( x1 y1 x2 y2 ) ; extract coordinates x1 = xCoord( lowerLeft( bBox ) ) y1 = yCoord( lowerLeft( bBox ) ) x2 = xCoord( upperRight( bBox ) ) y2 = yCoord( upperRight( bBox ) ) ; create shape if( (c>0) dbCreatePolygon( pcCellView layer 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) ) dbCreateRect( pcCellView layer list( x1:y1 x2:y2 ) ) ) ))