5.5 Region
A Region object specifies a portion of a drawing area (possibly discontinuous). It is normally used for clipping drawing operations.
Region combination with operations like Rhombus.union are implemented by combining paths. Certain combinations work only if the paths have a suitable fill mode, which can be either #'winding, #'even_odd, or a flexible fill mode. When a region is installed as a device context’s clipping region, any subpath with a flexible fill mode uses #'even_odd mode if any other path uses #'even_odd mode.
method | |||||||
|
The fill style affects how well the region reliably combines with other regions via Region.union, Region.xor, and Region.subtract. The region is also atomic for the purposes of region combination.
The region corresponds to a clockwise path with a flexible fill. The region is also atomic for the purposes of region combination.
The region corresponds to a clockwise path with a flexible fill. The region is also atomic for the purposes of region combination.
The region corresponds to a clockwise path with a flexible fill. The region is also atomic for the purposes of region combination.
The region corresponds to a clockwise path with a flexible fill. The region is also atomic for the purposes of region combination.
method | |||||||
|
The fill style affects how well the region reliably combines with other regions via Region.union, Region.xor, and Region.subtract. The region is also atomic for the purposes of region combination.
method | |
| |
method | |
| |
| |
method | |
| |
| |
method | |
A Region.intersect corresponds to clipping with rgn’s path, and then clipping with rgn2’s path. Further combining sends to this region correspond to combination with the original path before initial clip, and further combination with this region as an argument correspond to a combination with the given path after the initial clip. Thus, an intersected region is a poor input for Region.union, Region.subtract, or Region.xor, but it intersects properly in further calls to Region.intersect.
A Region.union corresponds to combining the subpaths of each region into one path, using an #'odd_even fill if either of the region uses an #'odd_even fill (otherwise using a #'winding fill), a #'winding fill if either region uses a #'winding fill, or the fill remains a flexible fill if both paths have a flexible fill. Consequently, while the result is consistent across platforms and devices, it is a true union only for certain input regions. For example, it is a true union for non-overlapping atomic and union regions. It is also a true union for atomic and union regions (potentially overlapping) that are all clockwise and use #'winding fill or if the fills are all flexible fills.
A Region.subtract corresponds to combining the subpaths of rgn region with the reversed subpaths of rgn2, then intersecting the result with rgn. This fails as a true subtraction, because the boundary of loops (with either #'odd_even or #'winding filling) is ambiguous.
A Region.xor corresponds to combining the subpaths of rgn with the reversed subpaths of rgn2. The result uses an #'odd_even fill if either of the region uses an #'odd_even fill, a #'winding fill in either region uses a winding fill, or the fill remains a flexible fill if both paths have a flexible fill. Consequently, the result is a reliable xoring only for certain input regions. For example, it is reliable for atomic and xoring regions that all use #'odd_even fill.
enumeration | |||
|
property | |
| |
function | |