Changeset 32 for Include/Classes


Ignore:
Timestamp:
Dec 13, 2006, 9:19:48 PM (18 years ago)
Author:
OverTaker
Message:

Rectangleと同様の修正

File:
1 edited

Legend:

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

    r11 r32  
    2626    Sub RectangleF(location As PointF, size As SizeF)
    2727        x = location.X
    28         y = lccation.Y
     28        y = location.Y
    2929        width = size.Height
    30         hegiht = size.Height
     30        height = size.Height
    3131    End Sub
    3232
     
    3434        x = rc.x
    3535        y = rc.y
    36         widht = rc.width
     36        width = rc.width
    3737        height = rc.height
    3838    End Sub
     
    106106
    107107    Function IsEmpty() As BOOL
    108         If Width <= Single_EPSILON Or Height <= Single_EPSILON Then
    109             IsEmptyArea = _System_TRUE
    110         Else
    111             IsEmptyArea = _System_FALSE
     108        If Width <= 0 Or Height <= 0 Then
     109            IsEmpty = _System_TRUE
     110        Else
     111            IsEmpty = _System_FALSE
    112112        End If
    113113    End Function
     
    139139
    140140    Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As RectangleF
    141         Dim r As RectangleF(left, top, right - left, bottom - top)
    142         return r
     141        Dim rect As RectangleF(l, t, r - l, b - t)
     142        return rect
    143143    End Function
    144144
     
    156156
    157157    Function Contains(ByRef rc As RectangleF) As BOOL
    158         If X <= rc.X && rc.Right <= Right && Y <= rc.Y && rc.Bottom <= Bottom Then
     158        If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then
    159159            ContainsRCF = _System_TRUE
    160160        Else
     
    166166        X -= dx
    167167        Y -= dy
    168         Width = dx + dx
    169         Height = dy + dy
     168        Width += dx + dx
     169        Height += dy + dy
    170170    End Sub
    171171
    172172    Sub Inflate(sz As SizeF)
    173173        Inflate(sz.Width, sz.Height)
    174     End Sub
    175 
    176     Sub Inflate(pt As PointF)
    177         Inflate(pt.X, pt.Y)
    178174    End Sub
    179175
     
    183179    End Function
    184180
    185     Function Intersect(ByRef rect As RectangleF) As BOOL
    186         Intersect = Intersect(This, This, rect)
    187     End Function
    188 
     181    Sub Intersect(ByRef rect As RectangleF)
     182        This = RectangleF.Intersect(This, rect)
     183    End Sub
     184   
    189185    Static Function Intersect(ByRef a As RectangleF, ByRef b As RectangleF) As RectangleF
    190186        Dim right As Single, bottom As Single, left As Single, top As Single
     
    209205    Static Function Union(ByRef a As RectangleF, ByRef b As RectangleF) As RectangleF
    210206        Dim right As Single, bottom As Single, left As Single, top As Single
    211         right = Math.Max(a.GetRight(), b.GetRight())
    212         bottom = Math.Max(a.GetBottom(), b.GetBottom())
    213         left = Math.Max(a.GetLeft(), b.GetLeft())
    214         top = Math.Max(a.GetTop(), b.GetTop())
     207        right = Math.Max(a.Right(), b.Right())
     208        bottom = Math.Max(a.Bottom(), b.Bottom())
     209        left = Math.Max(a.Left(), b.Left())
     210        top = Math.Max(a.Top(), b.Top())
    215211        Return FromLTRB(left, top, right, bottom)
    216212    End Function
Note: See TracChangeset for help on using the changeset viewer.