- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Drawing/Rectangle.ab
r28 r11 27 27 Sub Rectangle(location As Point, size As Size) 28 28 x = location.X 29 y = l ocation.Y29 y = lccation.Y 30 30 width = size.Height 31 he ight = size.Height31 hegiht = size.Height 32 32 End Sub 33 33 … … 35 35 x = rc.x 36 36 y = rc.y 37 wid th= rc.width37 widht = rc.width 38 38 height = rc.height 39 39 End Sub … … 107 107 108 108 Function IsEmpty() As BOOL 109 If Width <= 0 Or Height <= 0Then110 IsEmpty = _System_TRUE111 Else 112 IsEmpty = _System_FALSE109 If Width <= Single_EPSILON Or Height <= Single_EPSILON Then 110 IsEmptyArea = _System_TRUE 111 Else 112 IsEmptyArea = _System_FALSE 113 113 End If 114 114 End Function … … 145 145 146 146 Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As Rectangle 147 Dim r ect As Rectangle(l, t, r - l, r - b)148 return r ect147 Dim r As Rectangle(left, top, right - left, bottom - top) 148 return r 149 149 End Function 150 150 … … 162 162 163 163 Function Contains(ByRef rc As Rectangle) As BOOL 164 If X <= rc.X And rc.Right <= Right And Y <= rc.Y Andrc.Bottom <= Bottom Then164 If X <= rc.X && rc.Right <= Right && Y <= rc.Y && rc.Bottom <= Bottom Then 165 165 ContainsRCF = _System_TRUE 166 166 Else … … 172 172 X -= dx 173 173 Y -= dy 174 Width += dx + dx175 Height += dy + dy174 Width = dx + dx 175 Height = dy + dy 176 176 End Sub 177 177 178 178 Sub Inflate(sz As Size) 179 179 Inflate(sz.Width, sz.Height) 180 End Sub 181 182 Sub Inflate(pt As Point) 183 Inflate(pt.X, pt.Y) 180 184 End Sub 181 185 … … 185 189 End Function 186 190 187 Sub Intersect(ByRef rect As Rectangle)188 This = Rectangle.Intersect(This, rect)189 End Sub191 Function Intersect(ByRef rect As Rectangle) As BOOL 192 Intersect = Intersect(This, This, rect) 193 End Function 190 194 191 195 Static Function Intersect(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle … … 195 199 left = Math.Min(a.Left, b.Left) 196 200 top = Math.Min(a.Top, b.Top) 197 Return Rectangle.FromLTRB(left, top, right, bottom)201 Return FromLTRB(left, top, right, bottom) 198 202 End Function 199 203 … … 211 215 Static Function Union(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle 212 216 Dim right As Single, bottom As Single, left As Single, top As Single 213 right = Math.Max(a. Right(), b.Right())214 bottom = Math.Max(a. Bottom(), b.Bottom())215 left = Math.Max(a. Left(), b.Left())216 top = Math.Max(a. Top(), b.Top())217 right = Math.Max(a.GetRight(), b.GetRight()) 218 bottom = Math.Max(a.GetBottom(), b.GetBottom()) 219 left = Math.Max(a.GetLeft(), b.GetLeft()) 220 top = Math.Max(a.GetTop(), b.GetTop()) 217 221 Return FromLTRB(left, top, right, bottom) 218 222 End Function
Note:
See TracChangeset
for help on using the changeset viewer.