Rectangle

public class Rectangle: Shape

Rectangle is a concrete subclass of Shape that has a special initialzer that creates a rectangle whose shape is determined by its frame.

  • Returns the corner size for the receiver.

    The shape of a C4Rectangle’s corners are specified with width and height.

    Automatically updates the shape of the receiver’s corners when set.

    let f = Rect(100,100,100,100)
    let r = Rectangle(frame: f)
    r.corner = Size(10,10)
    canvas.add(r)
    

    Declaration

    Swift

    public var corner: Size = Size(8, 8)
  • Initializes a new Rectangle using the specified frame.

    let f = Rect(100,100,100,100)
    let r = Rectangle(frame: f)
    canvas.add(r)
    

    Declaration

    Swift

    public override init(frame: Rect)

    Parameters

    frame

    A Rect whose dimensions are used to construct the Rectangle.

  • Undocumented

    Declaration

    Swift

    public class Rectangle: Shape