On this page:
Region
Region.dc
Region.is_  empty
Region.contains
Region.polygon
Region.rectangle
Region.rounded_  rectangle
Region.ellipse
Region.arc
Region.path
Region.union
Region.intersect
Region.subtract
Region.xor
Region.Fill
8.12

6 Region🔗ℹ

class

class Region():

  constructor (dc :: maybe(DC) = #false)

Creates a region, optionally specific to dc.

property

property (rgn :: Region).dc :: maybe(DC)

Reports the drawing context that the region is specific to, if any.

method

method (rgn :: Region).is_empty() :: Boolean

 

method

method (rgn :: Region).contains(pt :: PointLike) :: Boolean

Queries the content represented by the region.

method

method (rgn :: Region).polygon([pt :: PointLike, ...],

                               ~dpt: dpt :: PointLike = Point.zero,

                               ~dx: dx :: Real = 0,

                               ~dy: dy :: Real = 0,

                               ~fill: fill :: Region.Fill = #'even_odd)

  :: Void

 

method

method (rgn :: Region).rectangle(r :: RectLike)

  :: Void

 

method

method (rgn :: Region).rounded_rectangle(r :: RectLike,

                                         radius :: Real = -0.25)

  :: Void

 

method

method (rgn :: Region).ellipse(r :: RectLike)

  :: Void

 

method

method (rgn :: Region).arc(r :: RectLike,

                           start :: Real, end :: Real)

  :: Void

 

method

method (rgn :: Region).path(p :: Path,

                            ~dpt: dpt :: PointLike = Point.zero,

                            ~dx: dx :: Real = 0,

                            ~dy: dy :: Real = 0,

                            ~fill: fill :: Region.Fill = #'odd_even)

  :: Void

Adds to the region. A path or polygon is implicitly closed.

method

method (rgn :: Region).union(rgn2 :: Region) :: Void

 

method

method (rgn :: Region).intersect(rgn2 :: Region) :: Void

 

method

method (rgn :: Region).subtract(rgn2 :: Region) :: Void

 

method

method (rgn :: Region).xor(rgn2 :: Region) :: Void

Changes the region by applying a combination with another region. The other region, rgn2, is not modified.

annotation

Region.Fill

Satisfied by the following symbols: