--- In [email protected], "Ted Wall" <[EMAIL PROTECTED]> wrote:
>
> Bruce,
> 
> Along time ago, you talked about writing a Win.Pos1000(han, x, y, w, 
h).
> 
> If you are still interested in developing this, 

I think it is better to separate out the mapping of points from the 
changing of window size or position.

To map a point (x,y) defined relative to rectangle (l,t,r,b) to 
rectangle (lnew, tnew, rnew, bnew), I think you just need to calculate

xnew = (x-l)/(r-l) * (rnew-lnew) + xnew

and similarly for ynew.  Better to do this in float.  I can implement 
in win plug as
win.mappoints(fromrect, torect, points)
where all the arguments are blank separated coordinates and the 
results are the points mapped to the new rect as a series of blank 
separated coordinates in a string.

In looking at this, it seems that the rect and points work better if I 
use the convention 
left top right bottom 
for rectangles.  This is not the current convention for 
getarea/setarea, so I will have to change them to align with this, 
which will break some scripts.  Sorry about that...








Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to