Ignore:
Timestamp:
Aug 24, 2007, 11:14:46 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

フルコンパイルでのミスあぶり出し。註:修正は全て@300や@301以前に行われた。

File:
1 edited

Legend:

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

    r212 r303  
    106106
    107107    Function IsEmpty() As Boolean
    108         If Width <= 0 Or Height <= 0 Then
    109             IsEmpty = _System_TRUE
    110         Else
    111             IsEmpty = _System_FALSE
    112         End If
    113     End Function
    114 /*
    115     Function Operator =(ByRef rc As RectangleF)
    116         With rc
    117             x = .x
    118             y = .y
    119             width = .width
    120             height = .height
    121         End With
    122     End Function
    123 */
    124     Function Operator ==(rc As RectangleF)
     108        Return Width <= 0 Or Height <= 0
     109    End Function
     110
     111    Function Operator ==(rc As RectangleF) As Boolean
    125112        Return Equals(rc)
    126113    End Function
    127114
    128     Function Operator <>(rc As RectangleF)
     115    Function Operator <>(rc As RectangleF) As Boolean
    129116        Return Not Equals(rc)
    130117    End Function
    131118
    132119    Function Equals(rc As RectangleF) As Boolean
    133         If X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height Then
    134             Return True
    135         Else
    136             Return False
    137         End If
     120        Equals = (X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height)
    138121    End Function
    139122
     
    147130
    148131    Function Contains(x As Single, y As Single) As Boolean
    149         If x >= X And x < X + Width And y >= Y And y < Y + Height Then
    150             Contains = _System_TRUE
    151         Else
    152             Contains = _System_FALSE
    153         End If
     132        Contains = (x >= X And x < X + Width And y >= Y And y < Y + Height)
    154133    End Function
    155134
     
    159138
    160139    Function Contains(rc As RectangleF) As Boolean
    161         If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then
    162             Return True
    163         Else
    164             Return False
    165         End If
     140        Contains = (X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom)
    166141    End Function
    167142
    168143    Sub Inflate(dx As Single, dy As Single)
    169         X -= dx
    170         Y -= dy
    171         Width += dx + dx
    172         Height += dy + dy
     144        x -= dx
     145        y -= dy
     146        width += dx + dx
     147        height += dy + dy
    173148    End Sub
    174149
     
    178153
    179154    Static Function Inflate(rc As RectangleF, x As Single, y As Single) As RectangleF
    180         Inflate = New Rectangle(rc)
     155        Inflate = New RectangleF(rc.X, rc.Y, rc.Width, rc.Height)
    181156        Inflate.Inflate(x, y)
    182157    End Function
    183158
    184159    Sub Intersect(rect As RectangleF)
    185         This = RectangleF.Intersect(This, rect)
     160        Dim r = RectangleF.Intersect(This, rect)
     161        x = r.x
     162        y = r.y
     163        width = r.width
     164        height = r.height
    186165    End Sub
    187166   
    188167    Static Function Intersect(a As RectangleF, b As RectangleF) As RectangleF
    189168        Dim right As Single, bottom As Single, left As Single, top As Single
    190         right = Math.Min(a.Right, b.Right)
    191         bottom = Math.Min(a.Bottom, b.Bottom)
    192         left = Math.Min(a.Left, b.Left)
    193         top = Math.Min(a.Top, b.Top)
     169        right = System.Math.Min(a.Right, b.Right)
     170        bottom = System.Math.Min(a.Bottom, b.Bottom)
     171        left = System.Math.Min(a.Left, b.Left)
     172        top = System.Math.Min(a.Top, b.Top)
    194173        Return FromLTRB(left, top, right, bottom)
    195174    End Function
     
    200179            Right > rc.Left And _
    201180            Bottom > rc.Top Then
    202             IntersectsWith = _System_TRUE
     181            IntersectsWith = True
    203182        Else
    204             IntersectsWith = _System_FALSE
     183            IntersectsWith = False
    205184        End If
    206185    End Function
     
    208187    Static Function Union(a As RectangleF, b As RectangleF) As RectangleF
    209188        Dim right As Single, bottom As Single, left As Single, top As Single
    210         right = Math.Max(a.Right(), b.Right())
    211         bottom = Math.Max(a.Bottom(), b.Bottom())
    212         left = Math.Max(a.Left(), b.Left())
    213         top = Math.Max(a.Top(), b.Top())
     189        right = System.Math.Max(a.Right(), b.Right())
     190        bottom = System.Math.Max(a.Bottom(), b.Bottom())
     191        left = System.Math.Max(a.Left(), b.Left())
     192        top = System.Math.Max(a.Top(), b.Top())
    214193        Return FromLTRB(left, top, right, bottom)
    215194    End Function
     
    220199
    221200    Sub Offset(dx As Single, dy As Single)
    222         X += dx
    223         Y += dy
     201        x += dx
     202        y += dy
    224203    End Sub
    225204
Note: See TracChangeset for help on using the changeset viewer.