From ff47afdbca120fc382e9551ff829bc35956092d7 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 21 Oct 2005 02:16:32 +0000 Subject: Added scale to objects, and ability to clone objects --- vectorgfx.mod/vectorgfx.bmx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/vectorgfx.mod/vectorgfx.bmx b/vectorgfx.mod/vectorgfx.bmx index 098d9b2..dc84388 100644 --- a/vectorgfx.mod/vectorgfx.bmx +++ b/vectorgfx.mod/vectorgfx.bmx @@ -223,7 +223,11 @@ Type TVectorGfxObject Rem bbdoc: The angle of the object, as degrees*10. Must be within the range 0-3599 inclusive. EndRem - Field ang:Int + Field ang:Int + Rem + bbdoc: The scale of the object. + EndRem + Field scale:Double Field rotated:TVectorGfxPoint[] @@ -238,6 +242,22 @@ Type TVectorGfxObject x=0 y=0 ang=0 + scale=1 + End Method + + Rem + bbdoc: Clones this object + about: Returns a copy of this object, with its own copy of the line and points. + EndRem + Method Clone:TVectorGfxObject() + Local o:TVectorGfxObject=New TVectorGfxObject + o.x=x + o.y=y + o.ang=ang + o.scale=scale + o.SetPoints(points) + o.SetLines(lines) + Return o End Method Rem @@ -374,7 +394,7 @@ Type TVectorGfxObject rotated=New TVectorGfxPoint[points.length] For Local f:Int=0 Until points.length - Local p:TAlgoPoint=DoRotate(points[f].x,points[f].y,ang) + Local p:TAlgoPointD=DoRotateD(points[f].x*scale,points[f].y*scale,ang) rotated[f]=TVectorGfxPoint.Create(p.x,p.y) Next -- cgit v1.2.3