[futurebasic] RE: [FB] scaling, centering and rotating

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2005 : Group Archive : Group : All Groups

From: "Edwards, Waverly" <Waverly.Edwards@...>
Date: Tue, 1 Mar 2005 15:14:38 -0500
I will see how to apply it.
Scaling changes everything and I dont see the relationship yet.

Thanks,


W.





-----Original Message-----
From: Chris Stasny [mailto:staz@...]
Sent: Tuesday, March 01, 2005 8:33 AM
To: futurebasic@...
Subject: Re: [FB] scaling, centering and rotating


waverly,

mine may not be the cleanest of methods, but i use this...

/*
Center a moveable rect over a stationary rect
*/
local
dim deltaY,deltaX
dim @t,l,b,r
dim @sT,sL,sB,sR
local fn centerRect(@movingRect&, @stationaryRect&)
	'~'
	t;8  = movingRect&
	sT;8 = stationaryRect&
	deltaX = (l+r+sL+sR)\\2 -(r+l)
	deltaY = (t+b+sT+sB)\\2 -(t+b)
	OffsetRect(t,deltaX,deltaY)
	def CopyRect(t,#movingRect&)
end fn

-staz   -}-

On Feb 28, 2005, at 5:28 PM, Edwards, Waverly wrote:

>
> I'm probably missing the obvious but I'm having a hard time centering
> a rect within a rect.  T

--