Ignore:
File:
1 edited

Legend:

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

    r28 r11  
    2727    Sub Rectangle(location As Point, size As Size)
    2828        x = location.X
    29         y = location.Y
     29        y = lccation.Y
    3030        width = size.Height
    31         height = size.Height
     31        hegiht = size.Height
    3232    End Sub
    3333
     
    3535        x = rc.x
    3636        y = rc.y
    37         width = rc.width
     37        widht = rc.width
    3838        height = rc.height
    3939    End Sub
     
    107107
    108108    Function IsEmpty() As BOOL
    109         If Width <= 0 Or Height <= 0 Then
    110             IsEmpty = _System_TRUE
    111         Else
    112             IsEmpty = _System_FALSE
     109        If Width <= Single_EPSILON Or Height <= Single_EPSILON Then
     110            IsEmptyArea = _System_TRUE
     111        Else
     112            IsEmptyArea = _System_FALSE
    113113        End If
    114114    End Function
     
    145145
    146146    Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As Rectangle
    147         Dim rect As Rectangle(l, t, r - l, r - b)
    148         return rect
     147        Dim r As Rectangle(left, top, right - left, bottom - top)
     148        return r
    149149    End Function
    150150
     
    162162
    163163    Function Contains(ByRef rc As Rectangle) As BOOL
    164         If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then
     164        If X <= rc.X && rc.Right <= Right && Y <= rc.Y && rc.Bottom <= Bottom Then
    165165            ContainsRCF = _System_TRUE
    166166        Else
     
    172172        X -= dx
    173173        Y -= dy
    174         Width += dx + dx
    175         Height += dy + dy
     174        Width = dx + dx
     175        Height = dy + dy
    176176    End Sub
    177177
    178178    Sub Inflate(sz As Size)
    179179        Inflate(sz.Width, sz.Height)
     180    End Sub
     181
     182    Sub Inflate(pt As Point)
     183        Inflate(pt.X, pt.Y)
    180184    End Sub
    181185
     
    185189    End Function
    186190
    187     Sub Intersect(ByRef rect As Rectangle)
    188         This = Rectangle.Intersect(This, rect)
    189     End Sub
     191    Function Intersect(ByRef rect As Rectangle) As BOOL
     192        Intersect = Intersect(This, This, rect)
     193    End Function
    190194
    191195    Static Function Intersect(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle
     
    195199        left = Math.Min(a.Left, b.Left)
    196200        top = Math.Min(a.Top, b.Top)
    197         Return Rectangle.FromLTRB(left, top, right, bottom)
     201        Return FromLTRB(left, top, right, bottom)
    198202    End Function
    199203
     
    211215    Static Function Union(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle
    212216        Dim right As Single, bottom As Single, left As Single, top As Single
    213         right = Math.Max(a.Right(), b.Right())
    214         bottom = Math.Max(a.Bottom(), b.Bottom())
    215         left = Math.Max(a.Left(), b.Left())
    216         top = Math.Max(a.Top(), b.Top())
     217        right = Math.Max(a.GetRight(), b.GetRight())
     218        bottom = Math.Max(a.GetBottom(), b.GetBottom())
     219        left = Math.Max(a.GetLeft(), b.GetLeft())
     220        top = Math.Max(a.GetTop(), b.GetTop())
    217221        Return FromLTRB(left, top, right, bottom)
    218222    End Function
Note: See TracChangeset for help on using the changeset viewer.