logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

"Tickit::RectSet" - store a set of rectangular regions

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.40.0                                       2024-10-20                               Tickit::RectSet(3pm)

Constructor

new
          $rectset = Tickit::RectSet->new

       Returns a new "Tickit::RectSet" instance, initially empty.

Description

       Objects in this class store a set of rectangular regions. The object tracks which areas are covered, to
       ensure that overlaps are avoided, and that neighbouring regions are merged where possible. The order in
       which they are added is not important.

       New regions can be added using the "add" method. The "rects" method returns a list of non-overlapping
       Tickit::Rect regions, in top-to-bottom, left-to-right order.

Methods

rects
          @rects = $rectset->rects

       Returns a list of the covered regions, in order first top to bottom, then left to right.

   add
          $rectset->add( $rect )

       Adds the region covered by $rect to the stored region list.

   subtract
          $rectset->subtract( $rect )

       Removes any covered region that intersects with $rect from the stored region list.

   clear
          $rectset->clear

       Remove all the regions from the set.

   intersects
          $bool = $rectset->intersects( $rect )

       Returns true if $rect intersects with any region in the set.

   contains
          $bool = $rectset->contains( $rect )

       Returns true if $rect is entirely covered by the regions in the set. Note that it may be that the rect
       requires two or more regions in the set to completely cover it.

Name

       "Tickit::RectSet" - store a set of rectangular regions

See Also