Changeset 212 for Include/Classes/System/Drawing/RectangleF.ab
- Timestamp:
- Apr 13, 2007, 5:12:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Drawing/RectangleF.ab
r166 r212 31 31 End Sub 32 32 33 Sub RectangleF( ByRefrc As RectangleF)33 Sub RectangleF(rc As RectangleF) 34 34 x = rc.x 35 35 y = rc.y … … 43 43 End Function 44 44 45 Sub Location( ByRefpoint As PointF)45 Sub Location(point As PointF) 46 46 x = point.X 47 47 y = point.Y … … 52 52 End Function 53 53 54 Sub Size( ByRefsize As SizeF)54 Sub Size(size As SizeF) 55 55 width = size.Width 56 56 height = size.Height … … 112 112 End If 113 113 End Function 114 114 /* 115 115 Function Operator =(ByRef rc As RectangleF) 116 116 With rc … … 121 121 End With 122 122 End Function 123 124 Function Operator ==( ByRefrc As RectangleF)123 */ 124 Function Operator ==(rc As RectangleF) 125 125 Return Equals(rc) 126 126 End Function 127 127 128 Function Operator <>( ByRefrc As RectangleF)128 Function Operator <>(rc As RectangleF) 129 129 Return Not Equals(rc) 130 130 End Function 131 131 132 Function Equals( ByRefrc As RectangleF) As Boolean132 Function Equals(rc As RectangleF) As Boolean 133 133 If X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height Then 134 Equals = _System_TRUE135 Else 136 Equals = _System_FALSE134 Return True 135 Else 136 Return False 137 137 End If 138 138 End Function … … 143 143 144 144 Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As RectangleF 145 Dim rect As RectangleF(l, t, r - l, b - t) 146 return rect 145 return New RectangleF(l, t, r - l, b - t) 147 146 End Function 148 147 … … 155 154 End Function 156 155 157 Function Contains( ByRefpt As PointF) As Boolean158 ContainsPTF =Contains(pt.X, pt.Y)159 End Function 160 161 Function Contains( ByRefrc As RectangleF) As Boolean156 Function Contains(pt As PointF) As Boolean 157 Return Contains(pt.X, pt.Y) 158 End Function 159 160 Function Contains(rc As RectangleF) As Boolean 162 161 If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then 163 ContainsRCF = _System_TRUE164 Else 165 ContainsRCF = _System_FALSE162 Return True 163 Else 164 Return False 166 165 End If 167 166 End Function … … 178 177 End Sub 179 178 180 Static Function Inflate( ByRefrc As RectangleF, x As Single, y As Single) As RectangleF181 Inflate = rc179 Static Function Inflate(rc As RectangleF, x As Single, y As Single) As RectangleF 180 Inflate = New Rectangle(rc) 182 181 Inflate.Inflate(x, y) 183 182 End Function 184 183 185 Sub Intersect( ByRefrect As RectangleF)184 Sub Intersect(rect As RectangleF) 186 185 This = RectangleF.Intersect(This, rect) 187 186 End Sub 188 187 189 Static Function Intersect( ByRef a As RectangleF, ByRefb As RectangleF) As RectangleF188 Static Function Intersect(a As RectangleF, b As RectangleF) As RectangleF 190 189 Dim right As Single, bottom As Single, left As Single, top As Single 191 190 right = Math.Min(a.Right, b.Right) … … 196 195 End Function 197 196 198 Function IntersectsWith( ByRefrc As RectangleF) As Boolean197 Function IntersectsWith(rc As RectangleF) As Boolean 199 198 If Left < rc.Right And _ 200 199 Top < rc.Bottom And _ … … 207 206 End Function 208 207 209 Static Function Union( ByRef a As RectangleF, ByRefb As RectangleF) As RectangleF208 Static Function Union(a As RectangleF, b As RectangleF) As RectangleF 210 209 Dim right As Single, bottom As Single, left As Single, top As Single 211 210 right = Math.Max(a.Right(), b.Right())
Note:
See TracChangeset
for help on using the changeset viewer.