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
Region.Fill.odd_  even
Region.Fill.winding
8.16.0.4

6 Region🔗ℹ

class

class draw.Region():

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

Creates a region, optionally specific to dc.

property

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

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

method

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

 

method

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

Queries the content represented by the region.

method

method (rgn :: draw.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 :: draw.Region).rectangle(r :: RectLike)

  :: Void

 

method

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

                                              radius :: Real = -0.25)

  :: Void

 

method

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

  :: Void

 

method

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

                                start :: Real, end :: Real)

  :: Void

 

method

method (rgn :: draw.Region).path(

  p :: draw.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 :: draw.Region).union(rgn2 :: Region) :: Void

 

method

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

 

method

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

 

method

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

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

enumeration

enum draw.Region.Fill:

  odd_even

  winding

A region polygon-fill mode.