summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-10-23 01:05:01 +0000
committerIan C <ianc@noddybox.co.uk>2005-10-23 01:05:01 +0000
commit508f1229169dd298346dade8357e8db93313740f (patch)
treea0d561174b062427566768d01c612edf48706456
parentff47afdbca120fc382e9551ff829bc35956092d7 (diff)
Added fields to indicate size of objects
-rw-r--r--vectorgfx.mod/vectorgfx.bmx42
1 files changed, 42 insertions, 0 deletions
diff --git a/vectorgfx.mod/vectorgfx.bmx b/vectorgfx.mod/vectorgfx.bmx
index dc84388..57df6ee 100644
--- a/vectorgfx.mod/vectorgfx.bmx
+++ b/vectorgfx.mod/vectorgfx.bmx
@@ -221,6 +221,30 @@ Type TVectorGfxObject
EndRem
Field y:Int
Rem
+ bbdoc: The minimum X co-ordinate of the object. Only valid after a call to SetPoints().
+ EndRem
+ Field min_x:Int
+ Rem
+ bbdoc: The maximum X co-ordinate of the object. Only valid after a call to SetPoints().
+ EndRem
+ Field max_x:Int
+ Rem
+ bbdoc: The minimum Y co-ordinate of the object. Only valid after a call to SetPoints().
+ EndRem
+ Field min_y:Int
+ Rem
+ bbdoc: The maximum Y co-ordinate of the object. Only valid after a call to SetPoints().
+ EndRem
+ Field max_y:Int
+ Rem
+ bbdoc: The width of the object. Only valid after a call to SetPoints().
+ EndRem
+ Field width:Int
+ Rem
+ bbdoc: The height of the object. Only valid after a call to SetPoints().
+ EndRem
+ Field height:Int
+ Rem
bbdoc: The angle of the object, as degrees*10. Must be within the range 0-3599 inclusive.
EndRem
Field ang:Int
@@ -241,6 +265,12 @@ Type TVectorGfxObject
rotated=Null
x=0
y=0
+ min_x=9999999
+ min_y=9999999
+ max_x=-9999999
+ max_y=-9999999
+ width=0
+ height=0
ang=0
scale=1
End Method
@@ -253,6 +283,12 @@ Type TVectorGfxObject
Local o:TVectorGfxObject=New TVectorGfxObject
o.x=x
o.y=y
+ o.min_x=min_x
+ o.min_y=min_y
+ o.max_x=max_x
+ o.max_y=max_y
+ o.width=width
+ o.height=height
o.ang=ang
o.scale=scale
o.SetPoints(points)
@@ -268,7 +304,13 @@ Type TVectorGfxObject
points=New TVectorGfxPoint[pa.length]
For Local f:Int=0 Until pa.length
points[f]=TVectorGfxPoint(pa[f])
+ min_x=Min(min_x,points[f].x)
+ min_y=Min(min_y,points[f].y)
+ max_x=Max(max_x,points[f].x)
+ max_y=Max(max_y,points[f].y)
Next
+ width=max_x-min_x
+ height=max_y-min_y
End Method
Rem