Changeset 473 for trunk/Include/Classes/System/Drawing/Size.ab
- Timestamp:
- Mar 12, 2008, 9:54:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Drawing/Size.ab
r335 r473 1 1 ' Classes/System/Drawing/Size.ab 2 2 3 #ifndef __SYSTEM_DRAWING_SIZE_AB__ 4 #define __SYSTEM_DRAWING_SIZE_AB__ 5 6 '#include <Classes/System/Math.ab> 7 #include <Classes/System/Drawing/SizeF.ab> 3 Namespace System 4 Namespace Drawing 8 5 9 6 Class Size … … 41 38 42 39 Function Operator +(sz As Size) As Size 43 Dim ret As Size(width + sz.width, height + sz.height) 44 Return ret 40 Return New Size(width + sz.width, height + sz.height) 45 41 End Function 46 42 47 43 Function Operator -(sz As Size) As Size 48 Dim ret As Size(width - sz.width, height - sz.height) 49 Return ret 44 Return New Size(width - sz.width, height - sz.height) 50 45 End Function 51 46 52 47 Function Operator () As SizeF 53 Dim szf As SizeF(width, height) 54 Return szf 48 Return New SizeF(width, height) 55 49 End Function 56 50 … … 62 56 Return Not Equals(sz) 63 57 End Function 64 /* 65 Sub Operator =(ByRef sz As Size) 66 width = sz.width 67 height = sz.height 68 End Sub 69 */ 58 70 59 Function Equals(sz As Size) As Boolean 71 60 If width = sz.width And height = sz.height Then … … 93 82 94 83 Static Function Ceiling(szf As SizeF) As Size 95 Dim sz As Size(System.Math.Ceiling(szf.Width) As Long, System.Math.Ceiling(szf.Height) As Long) 96 Return sz 84 Return New Size(System.Math.Ceiling(szf.Width) As Long, System.Math.Ceiling(szf.Height) As Long) 97 85 End Function 98 86 99 87 Static Function Round(szf As SizeF) As Size 100 Dim sz As Size(System.Math.Round(szf.Width) As Long, System.Math.Round(szf.Height) As Long) 101 Return sz 88 Return New Size(System.Math.Round(szf.Width) As Long, System.Math.Round(szf.Height) As Long) 102 89 End Function 103 90 104 91 Static Function Truncate(szf As SizeF) As Size 105 Dim sz As Size(System.Math.Truncate(szf.Width) As Long, System.Math.Truncate(szf.Height) As Long) 106 Return sz 92 Return New Size(System.Math.Truncate(szf.Width) As Long, System.Math.Truncate(szf.Height) As Long) 107 93 End Function 108 94 … … 112 98 End Class 113 99 114 #endif '__SYSTEM_DRAWING_SIZE_AB__ 100 End Namespace 101 End Namespace
Note:
See TracChangeset
for help on using the changeset viewer.