Ignore:
Timestamp:
Apr 13, 2007, 5:12:31 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

Object.ReferenceEqualsを追加

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Drawing/RectangleF.ab

    r166 r212  
    3131    End Sub
    3232
    33     Sub RectangleF(ByRef rc As RectangleF)
     33    Sub RectangleF(rc As RectangleF)
    3434        x = rc.x
    3535        y = rc.y
     
    4343    End Function
    4444
    45     Sub Location(ByRef point As PointF)
     45    Sub Location(point As PointF)
    4646        x = point.X
    4747        y = point.Y
     
    5252    End Function
    5353
    54     Sub Size(ByRef size As SizeF)
     54    Sub Size(size As SizeF)
    5555        width = size.Width
    5656        height = size.Height
     
    112112        End If
    113113    End Function
    114 
     114/*
    115115    Function Operator =(ByRef rc As RectangleF)
    116116        With rc
     
    121121        End With
    122122    End Function
    123 
    124     Function Operator ==(ByRef rc As RectangleF)
     123*/
     124    Function Operator ==(rc As RectangleF)
    125125        Return Equals(rc)
    126126    End Function
    127127
    128     Function Operator <>(ByRef rc As RectangleF)
     128    Function Operator <>(rc As RectangleF)
    129129        Return Not Equals(rc)
    130130    End Function
    131131
    132     Function Equals(ByRef rc As RectangleF) As Boolean
     132    Function Equals(rc As RectangleF) As Boolean
    133133        If X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height Then
    134             Equals = _System_TRUE
    135         Else
    136             Equals = _System_FALSE
     134            Return True
     135        Else
     136            Return False
    137137        End If
    138138    End Function
     
    143143
    144144    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)
    147146    End Function
    148147
     
    155154    End Function
    156155
    157     Function Contains(ByRef pt As PointF) As Boolean
    158         ContainsPTF = Contains(pt.X, pt.Y)
    159     End Function
    160 
    161     Function Contains(ByRef rc As RectangleF) As Boolean
     156    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
    162161        If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then
    163             ContainsRCF = _System_TRUE
    164         Else
    165             ContainsRCF = _System_FALSE
     162            Return True
     163        Else
     164            Return False
    166165        End If
    167166    End Function
     
    178177    End Sub
    179178
    180     Static Function Inflate(ByRef rc As RectangleF, x As Single, y As Single) As RectangleF
    181         Inflate = rc
     179    Static Function Inflate(rc As RectangleF, x As Single, y As Single) As RectangleF
     180        Inflate = New Rectangle(rc)
    182181        Inflate.Inflate(x, y)
    183182    End Function
    184183
    185     Sub Intersect(ByRef rect As RectangleF)
     184    Sub Intersect(rect As RectangleF)
    186185        This = RectangleF.Intersect(This, rect)
    187186    End Sub
    188187   
    189     Static Function Intersect(ByRef a As RectangleF, ByRef b As RectangleF) As RectangleF
     188    Static Function Intersect(a As RectangleF, b As RectangleF) As RectangleF
    190189        Dim right As Single, bottom As Single, left As Single, top As Single
    191190        right = Math.Min(a.Right, b.Right)
     
    196195    End Function
    197196
    198     Function IntersectsWith(ByRef rc As RectangleF) As Boolean
     197    Function IntersectsWith(rc As RectangleF) As Boolean
    199198        If Left < rc.Right And _
    200199            Top < rc.Bottom And _
     
    207206    End Function
    208207
    209     Static Function Union(ByRef a As RectangleF, ByRef b As RectangleF) As RectangleF
     208    Static Function Union(a As RectangleF, b As RectangleF) As RectangleF
    210209        Dim right As Single, bottom As Single, left As Single, top As Single
    211210        right = Math.Max(a.Right(), b.Right())
Note: See TracChangeset for help on using the changeset viewer.