Changeset 32 for Include/Classes/System/Drawing/RectangleF.ab
- Timestamp:
- Dec 13, 2006, 9:19:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Drawing/RectangleF.ab
r11 r32 26 26 Sub RectangleF(location As PointF, size As SizeF) 27 27 x = location.X 28 y = l ccation.Y28 y = location.Y 29 29 width = size.Height 30 he giht = size.Height30 height = size.Height 31 31 End Sub 32 32 … … 34 34 x = rc.x 35 35 y = rc.y 36 wid ht= rc.width36 width = rc.width 37 37 height = rc.height 38 38 End Sub … … 106 106 107 107 Function IsEmpty() As BOOL 108 If Width <= Single_EPSILON Or Height <= Single_EPSILONThen109 IsEmpty Area= _System_TRUE110 Else 111 IsEmpty Area= _System_FALSE108 If Width <= 0 Or Height <= 0 Then 109 IsEmpty = _System_TRUE 110 Else 111 IsEmpty = _System_FALSE 112 112 End If 113 113 End Function … … 139 139 140 140 Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As RectangleF 141 Dim r As RectangleF(left, top, right - left, bottom - top)142 return r 141 Dim rect As RectangleF(l, t, r - l, b - t) 142 return rect 143 143 End Function 144 144 … … 156 156 157 157 Function Contains(ByRef rc As RectangleF) As BOOL 158 If X <= rc.X && rc.Right <= Right && Y <= rc.Y &&rc.Bottom <= Bottom Then158 If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then 159 159 ContainsRCF = _System_TRUE 160 160 Else … … 166 166 X -= dx 167 167 Y -= dy 168 Width = dx + dx169 Height = dy + dy168 Width += dx + dx 169 Height += dy + dy 170 170 End Sub 171 171 172 172 Sub Inflate(sz As SizeF) 173 173 Inflate(sz.Width, sz.Height) 174 End Sub175 176 Sub Inflate(pt As PointF)177 Inflate(pt.X, pt.Y)178 174 End Sub 179 175 … … 183 179 End Function 184 180 185 Function Intersect(ByRef rect As RectangleF) As BOOL186 Intersect = Intersect(This,This, rect)187 End Function188 181 Sub Intersect(ByRef rect As RectangleF) 182 This = RectangleF.Intersect(This, rect) 183 End Sub 184 189 185 Static Function Intersect(ByRef a As RectangleF, ByRef b As RectangleF) As RectangleF 190 186 Dim right As Single, bottom As Single, left As Single, top As Single … … 209 205 Static Function Union(ByRef a As RectangleF, ByRef b As RectangleF) As RectangleF 210 206 Dim right As Single, bottom As Single, left As Single, top As Single 211 right = Math.Max(a. GetRight(), b.GetRight())212 bottom = Math.Max(a. GetBottom(), b.GetBottom())213 left = Math.Max(a. GetLeft(), b.GetLeft())214 top = Math.Max(a. GetTop(), b.GetTop())207 right = Math.Max(a.Right(), b.Right()) 208 bottom = Math.Max(a.Bottom(), b.Bottom()) 209 left = Math.Max(a.Left(), b.Left()) 210 top = Math.Max(a.Top(), b.Top()) 215 211 Return FromLTRB(left, top, right, bottom) 216 212 End Function
Note:
See TracChangeset
for help on using the changeset viewer.