Changeset 28 for Include


Ignore:
Timestamp:
Dec 11, 2006, 11:25:03 PM (18 years ago)
Author:
OverTaker
Message:

記述ミスを修正

File:
1 edited

Legend:

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

    r11 r28  
    2727    Sub Rectangle(location As Point, size As Size)
    2828        x = location.X
    29         y = lccation.Y
     29        y = location.Y
    3030        width = size.Height
    31         hegiht = size.Height
     31        height = size.Height
    3232    End Sub
    3333
     
    3535        x = rc.x
    3636        y = rc.y
    37         widht = rc.width
     37        width = rc.width
    3838        height = rc.height
    3939    End Sub
     
    107107
    108108    Function IsEmpty() As BOOL
    109         If Width <= Single_EPSILON Or Height <= Single_EPSILON Then
    110             IsEmptyArea = _System_TRUE
    111         Else
    112             IsEmptyArea = _System_FALSE
     109        If Width <= 0 Or Height <= 0 Then
     110            IsEmpty = _System_TRUE
     111        Else
     112            IsEmpty = _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 r As Rectangle(left, top, right - left, bottom - top)
    148         return r
     147        Dim rect As Rectangle(l, t, r - l, r - b)
     148        return rect
    149149    End Function
    150150
     
    162162
    163163    Function Contains(ByRef rc As Rectangle) As BOOL
    164         If X <= rc.X && rc.Right <= Right && Y <= rc.Y && rc.Bottom <= Bottom Then
     164        If X <= rc.X And rc.Right <= Right And Y <= rc.Y And 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)
    184180    End Sub
    185181
     
    189185    End Function
    190186
    191     Function Intersect(ByRef rect As Rectangle) As BOOL
    192         Intersect = Intersect(This, This, rect)
    193     End Function
     187    Sub Intersect(ByRef rect As Rectangle)
     188        This = Rectangle.Intersect(This, rect)
     189    End Sub
    194190
    195191    Static Function Intersect(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle
     
    199195        left = Math.Min(a.Left, b.Left)
    200196        top = Math.Min(a.Top, b.Top)
    201         Return FromLTRB(left, top, right, bottom)
     197        Return Rectangle.FromLTRB(left, top, right, bottom)
    202198    End Function
    203199
     
    215211    Static Function Union(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle
    216212        Dim right As Single, bottom As Single, left As Single, top As Single
    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())
     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())
    221217        Return FromLTRB(left, top, right, bottom)
    222218    End Function
Note: See TracChangeset for help on using the changeset viewer.