diff options
| author | ruki <[email protected]> | 2017-12-14 22:56:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-12-14 11:40:00 +0800 |
| commit | b4c46182afdf442505f22bbf864ef2811933da49 (patch) | |
| tree | 92c899970035ac4a40477267c1256e9c032fc9fe /xmake/core/ui/rect.lua | |
| parent | 54a0bf3c8688589708af4cc22bd7bbe8a83365d1 (diff) | |
improve compiler version
Diffstat (limited to 'xmake/core/ui/rect.lua')
| -rw-r--r-- | xmake/core/ui/rect.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/core/ui/rect.lua b/xmake/core/ui/rect.lua index c7a11330f..0bb4ad958 100644 --- a/xmake/core/ui/rect.lua +++ b/xmake/core/ui/rect.lua @@ -72,6 +72,11 @@ function rect:grow(dx, dy) return self end +-- is intersect? +function rect:is_intersect(r) + return not self():intersect(r):empty() +end + -- set rect with shared area between this rect and a given rect function rect:intersect(r) self.sx = math.max(self.sx, r.sx) |
