OLD | NEW |
| 1 -- Experimental helpers for skia -- |
| 2 |
1 Sk = {} | 3 Sk = {} |
2 | 4 |
3 function Sk.isFinite(x) | 5 function Sk.isFinite(x) |
4 return x * 0 == 0 | 6 return x * 0 == 0 |
5 end | 7 end |
6 | 8 |
7 ------------------------------------------------------------------------------- | 9 ------------------------------------------------------------------------------- |
8 | 10 |
9 Sk.Rect = { left = 0, top = 0, right = 0, bottom = 0 } | 11 Sk.Rect = { left = 0, top = 0, right = 0, bottom = 0 } |
10 Sk.Rect.__index = Sk.Rect | 12 Sk.Rect.__index = Sk.Rect |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 function Sk.Rect:inset(dx, dy) | 73 function Sk.Rect:inset(dx, dy) |
72 dy = dy or dx | 74 dy = dy or dx |
73 | 75 |
74 self.left = self.left + dx | 76 self.left = self.left + dx |
75 self.top = self.top + dy | 77 self.top = self.top + dy |
76 self.right = self.right - dx | 78 self.right = self.right - dx |
77 self.bottom = self.bottom - dy | 79 self.bottom = self.bottom - dy |
78 end | 80 end |
79 | 81 |
80 ------------------------------------------------------------------------------- | 82 ------------------------------------------------------------------------------- |
81 | |
OLD | NEW |