Rectangle

smile.pictures.Rectangle
object Rectangle

Factory object for creating rectangles.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Rectangle.type

Members list

Value members

Concrete methods

def apply(sideLength: Double, fillStyle: Option[FillStyle], strokeStyle: Option[StrokeStyle]): VectorGraphic

Creates a square with a given side length, fill style, and stroke style.

Creates a square with a given side length, fill style, and stroke style.

Value parameters

fillStyle

Optional fill style for the square.

sideLength

The length of each side of the square.

strokeStyle

Optional stroke style for the square.

Attributes

Returns

A VectorGraphic representing the square.

def apply(sideLength: Double, center: Pos, fillStyle: Option[FillStyle], strokeStyle: Option[StrokeStyle]): VectorGraphic

Creates a square with a given side length, center position, fill style, and stroke style.

Creates a square with a given side length, center position, fill style, and stroke style.

Value parameters

center

The center position of the square.

fillStyle

Optional fill style for the square.

sideLength

The length of each side of the square.

strokeStyle

Optional stroke style for the square.

Attributes

Returns

A VectorGraphic representing the square.

Throws
IllegalArgumentException

If the side length is negative.

def apply(baseLength: Double, height: Double, fillStyle: Option[FillStyle], strokeStyle: Option[StrokeStyle]): VectorGraphic

Creates a rectangle with a given base length, height, fill style, and stroke style.

Creates a rectangle with a given base length, height, fill style, and stroke style.

Value parameters

baseLength

The length of the base of the rectangle.

fillStyle

Optional fill style for the rectangle.

height

The height of the rectangle.

strokeStyle

Optional stroke style for the rectangle.

Attributes

Returns

A VectorGraphic representing the rectangle.

def apply(baseLength: Double, height: Double, center: Pos, fillStyle: Option[FillStyle], strokeStyle: Option[StrokeStyle]): VectorGraphic

Creates a rectangle with a given base length, height, center position, fill style, and stroke style.

Creates a rectangle with a given base length, height, center position, fill style, and stroke style.

Value parameters

baseLength

The length of the base of the rectangle.

center

The center position of the rectangle.

fillStyle

Optional fill style for the rectangle.

height

The height of the rectangle.

strokeStyle

Optional stroke style for the rectangle.

Attributes

Returns

A VectorGraphic representing the rectangle.

Throws
IllegalArgumentException

If the base length or height is negative.