Changeset 303 for trunk/Include/Classes/System/Drawing/Rectangle.ab
- Timestamp:
- Aug 24, 2007, 11:14:46 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Drawing/Rectangle.ab
r223 r303 110 110 End Function 111 111 112 Function Operator == (rc As Rectangle) 112 Function Operator == (rc As Rectangle) As Boolean 113 113 Return Equals(rc) 114 114 End Function 115 115 116 Function Operator <> (rc As Rectangle) 117 Return Not Equals(rc)116 Function Operator <> (rc As Rectangle) As Boolean 117 Return (Not Equals(rc)) 118 118 End Function 119 119 … … 147 147 148 148 Sub Inflate(dx As Long, dy As Long) 149 X-= dx150 Y-= dy151 Width += dx + dx152 Height += dy + dy149 x -= dx 150 y -= dy 151 width += dx + dx 152 height += dy + dy 153 153 End Sub 154 154 … … 158 158 159 159 Static Function Inflate(rc As Rectangle, x As Long, y As Long) As Rectangle 160 Inflate = New Rectangle(rc )160 Inflate = New Rectangle(rc.X, rc.Y, rc.Width, rc.Height) 161 161 Inflate.Inflate(x, y) 162 162 End Function 163 163 164 164 Sub Intersect(rect As Rectangle) 165 This = Rectangle.Intersect(This, rect) 165 Dim r = Rectangle.Intersect(This, rect) 166 x = r.x 167 y = r.y 168 width = r.width 169 height = r.height 166 170 End Sub 167 171 168 172 Static Function Intersect(a As Rectangle, ByRef b As Rectangle) As Rectangle 169 173 Dim right As Long, bottom As Long, left As Long, top As Long 170 right = Math.Min(a.Right, b.Right)171 bottom = Math.Min(a.Bottom, b.Bottom)172 left = Math.Min(a.Left, b.Left)173 top = Math.Min(a.Top, b.Top)174 right = System.Math.Min(a.Right, b.Right) 175 bottom = System.Math.Min(a.Bottom, b.Bottom) 176 left = System.Math.Min(a.Left, b.Left) 177 top = System.Math.Min(a.Top, b.Top) 174 178 Return Rectangle.FromLTRB(left, top, right, bottom) 175 179 End Function … … 184 188 Static Function Union(a As Rectangle, b As Rectangle) As Rectangle 185 189 Dim right As Long, bottom As Long, left As Long, top As Long 186 right = Math.Max(a.Right(), b.Right())187 bottom = Math.Max(a.Bottom(), b.Bottom())188 left = Math.Max(a.Left(), b.Left())189 top = Math.Max(a.Top(), b.Top())190 right = System.Math.Max(a.Right(), b.Right()) 191 bottom = System.Math.Max(a.Bottom(), b.Bottom()) 192 left = System.Math.Max(a.Left(), b.Left()) 193 top = System.Math.Max(a.Top(), b.Top()) 190 194 Return FromLTRB(left, top, right, bottom) 191 195 End Function … … 196 200 197 201 Sub Offset(dx As Long, dy As Long) 198 X+= dx199 Y+= dy202 x += dx 203 y += dy 200 204 End Sub 201 205 202 206 Static Function Ceiling(rcf As RectangleF) As Rectangle 203 207 Dim r As Rectangle( 204 Math.Ceiling(rcf.X),205 Math.Ceiling(rcf.Y),206 Math.Ceiling(rcf.Width),207 Math.Ceiling(rcf.Height))208 System.Math.Ceiling(rcf.X) As Long, 209 System.Math.Ceiling(rcf.Y) As Long, 210 System.Math.Ceiling(rcf.Width) As Long, 211 System.Math.Ceiling(rcf.Height) As Long) 208 212 Return r 209 213 End Function … … 211 215 Static Function Round(rcf As RectangleF) As Rectangle 212 216 Dim r As Rectangle( 213 Math.Round(rcf.X),214 Math.Round(rcf.Y),215 Math.Round(rcf.Width),216 Math.Round(rcf.Height))217 System.Math.Round(rcf.X) As Long, 218 System.Math.Round(rcf.Y) As Long, 219 System.Math.Round(rcf.Width) As Long, 220 System.Math.Round(rcf.Height) As Long) 217 221 Return r 218 222 End Function … … 220 224 Static Function Truncate(rcf As RectangleF) As Rectangle 221 225 Dim r As Rectangle( 222 Math.Truncate(rcf.X),223 Math.Truncate(rcf.Y),224 Math.Truncate(rcf.Width),225 Math.Truncate(rcf.Height))226 System.Math.Truncate(rcf.X) As Long, 227 System.Math.Truncate(rcf.Y) As Long, 228 System.Math.Truncate(rcf.Width) As Long, 229 System.Math.Truncate(rcf.Height) As Long) 226 230 Return r 227 231 End Function
Note:
See TracChangeset
for help on using the changeset viewer.