Ignore:
Timestamp:
Dec 11, 2006, 6:14:09 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

Addを静的メソッドへ

Location:
Include/Classes/System/Drawing
Files:
2 edited

Legend:

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

    r11 r27  
    44#define __SYSTEM_DRAWING_POINT_AB__
    55
     6#include <Classes/System/Drawing/PointF.ab>
    67#include <Classes/System/Drawing/Size.ab>
    78#include <Classes/System/Drawing/SizeF.ab>
     
    6465
    6566    Function Operator + (pt As Point) As Point
    66         Return Add(pt)
     67        Return Add(This, pt)
    6768    End Function
    6869
    6970    Function Operator + (sz As Size) As Point
    70         Return Add(sz)
     71        Return Add(This, sz)
    7172    End Function
    7273
    7374    Function Operator - (pt As Point) As Point
    74         Return Substract(pt)
     75        Return Substract(This, pt)
    7576    End Function
    7677
    7778    Function Operator - (sz As Size) As Point
    78         Return Substract(sz)
     79        Return Substract(This, sz)
    7980    End Function
    8081
     
    8788    End Function
    8889
    89     Function Add(pt As Point) As Point
     90    Static Function Add(pt1 As Point, pt2 As Point) As Point
     91        Dim ret As Point(pt1.x + pt2.x, pt1.y + pt2.y)
     92        Return ret
     93    End Function
     94
     95    Static Function Add(pt As Point, sz As Size) As Point
     96        Dim ret As Point(pt.x + sz.Width, pt.y + sz.Height)
     97        Return ret
     98    End Function
     99
     100    Sub Offset(pt As Point) As Point
    90101        Dim ret As Point(x + pt.x, y + pt.y)
    91102        Return ret
    92103    End Function
    93104
    94     Function Add(sz As Size) As Point
    95         Dim ret As Point(x + sz.width, y + sz.height)
     105    Sub Offset(dx As Long, dy As Long)
     106        x += dx
     107        y += dy
     108    End Function
     109
     110    Static Function Substract(pt1 As Point, pt2 As Point) As Point
     111        Dim ret As Point(pt1.x - pt2.x, pt1.y - pt2.y)
    96112        Return ret
    97113    End Function
    98114
    99     Function Offset(pt As Point) As Point
    100         Dim ret As Point(x + pt.x, y + pt.y)
    101     End Function
    102 
    103     Function Offset(dx As Long, dy As Long) As Point
    104         Dim ret As Point(x + dx, y + dy)
    105     End Function
    106 
    107     Function Substract(pt As Point) As Point
    108         Dim ret As Point(x - pt.x, y - pt.y)
    109         Return ret
    110     End Function
    111 
    112     Function Substract(sz As Size) As Point
    113         Dim ret As Point(x - sz.width, y - sz.height)
     115    Static Function Substract(pt As Point, sz As Size) As Point
     116        Dim ret As Point(pt.x - sz.Width, pt.y - sz.Height)
    114117        Return ret
    115118    End Function
  • Include/Classes/System/Drawing/PointF.ab

    r1 r27  
    5858    End Sub
    5959
     60    Function Operator () As PointF
     61        Dim ptf As PointF(X, Y)
     62        Return ptf
     63    End Function
     64
    6065    Function Operator + (pt As PointF) As PointF
    61         Return Add(pt)
     66        Return Add(This, pt)
    6267    End Function
    6368
    6469    Function Operator + (sz As Size) As PointF
    65         Return Add(sz)
     70        Return Add(This, sz)
    6671    End Function
    6772
    6873    Function Operator + (sz As SizeF) As PointF
    69         Return Add(sz)
     74        Return Add(This, sz)
    7075    End Function
    7176
    7277    Function Operator - (pt As PointF) As PointF
    73         Return Substract(pt)
     78        Return Substract(This, pt)
    7479    End Function
    7580
    7681    Function Operator - (sz As Size) As PointF
    77         Return Substract(sz)
     82        Return Substract(This, sz)
    7883    End Function
    7984
    8085    Function Operator - (sz As SizeF) As PointF
    81         Return Substract(sz)
     86        Return Substract(This, sz)
    8287    End Function
    8388
     
    9095    End Function
    9196
    92     Function Add(pt As PointF) As PointF
    93         Dim ret As PointF(x + pt.x, y + pt.y)
     97    Static Function Add(pt1 As PointF, pt2 As PointF) As PointF
     98        Dim ret As PointF(pt1.x + pt2.x, pt1.y + pt2.y)
    9499        Return ret
    95100    End Function
    96101
    97     Function Add(sz As Size) As PointF
    98         Dim ret As PointF(x + sz.width, y + sz.height)
     102    Static Function Add(pt As PointF, sz As Size) As PointF
     103        Dim ret As PointF(pt.x + sz.Width, pt.y + sz.Height)
    99104        Return ret
    100105    End Function
    101106
    102     Function Add(sz As SizeF) As PointF
    103         Dim ret As PointF(x + sz.width, y + sz.height)
     107    Static Function Add(pt As PointF, sz As SizeF) As PointF
     108        Dim ret As PointF(pt.x + sz.Width, pt.y + sz.Height)
    104109        Return ret
    105110    End Function
    106111
    107     Function Substract(pt As PointF) As PointF
    108         Dim ret As PointF(x - pt.x, y - pt.y)
     112    Static Function Substract((pt1 As PointF, pt2 As PointF) As PointF
     113        Dim ret As PointF(pt1.x - pt2.x, pt1.y - pt2.y)
    109114        Return ret
    110115    End Function
    111116
    112     Function Substract(sz As Size) As PointF
    113         Dim ret As PointF(x - sz.width, y - sz.height)
     117    Static Function Substract(pt As PointF, sz As Size) As PointF
     118        Dim ret As PointF(pt.x - sz.Width, pt.y - sz.Height)
    114119        Return ret
    115120    End Function
    116121
    117     Function Substract(sz As SizeF) As PointF
    118         Dim ret As PointF(x - sz.width, y - sz.height)
     122    Static Function Substract(pt As PointF, sz As SizeF) As PointF
     123        Dim ret As PointF(pt.x - sz.Width, pt.y - sz.Height)
    119124        Return ret
    120125    End Function
Note: See TracChangeset for help on using the changeset viewer.