I knew I'd find a mistake when I hit send. :| If the upper and lower edge are parallel to the X axis, then obviously you can use three /vertical/ strips, scale the middle part, and move the right strip.
Mark On Sun, Aug 31, 2008 at 6:49 PM, Mark Winterhalder <[EMAIL PROTECTED]> wrote: > Matt, > > if I understand you correctly, then this is only possible for > parallelograms that have sides perpendicular to the axis you want to > scale along to, i.e., parallel to the Y axis in your case. You will > always change the slope of a line that is not parallel to one of the > axis if you scale a clip to something where scaleX != scaleY, and thus > distort any angles. > > /If/ the left and right edges of your parallelogram are parallel to > the Y axis, then you can cut it into three horizontal strips. So, the > upper and lower strip would contain the diagonal sides and parts of > the (strictly vertical) right and left edges. The middle strip would > only contain the middle parts of the left and right edges and no > angles. > To scale that parallelogram along the X axis, you increase the scaleX > and scaleY of the outer strips and the scaleX of the middle strip by > an equal amount, and reduce the height of the middle strip by what the > outer two gained to compensate for the vertical growth (simply set it > to desiredHeight - upperStrip.height - lowerStrip.height.) You can > avoid relocation math by having the control point of the lower strip > at the bottom left, and the one of the middle trip at center left. > That way, the total width of the parallelogram increases, the height > remains constant, and your angles are maintained. > > Mark > > > > > On Sun, Aug 31, 2008 at 3:06 PM, Matt S. <[EMAIL PROTECTED]> wrote: >> So I have a parallelogram ( >> http://thesaurus.maths.org/mmkb/media/png/AreaofParallelogram.png ) >> which I need to scaleX up from 1 to 50, while maintaining the angles >> of the sides . The problem of course is that just increasing scaleX >> will cause the angles to distort. I cant use scale9 because the >> parallelogram needs to start as a 5 pixel sliver, which means the >> angled parts would overlap at the smallest state. I'm thinking I might >> need to dynamically draw it on enterFrame, deleting and redrawing each >> time, but perhaps someone has a better suggestion? Imagine a >> parallelogram that starts out at 5 pixels wide and height=stageHeight, >> and expands horizontally to a width of stageWidth, without losing the >> angles on the sides. Any suggestions much appreciated. >> >> tia, >> >> .m >> _______________________________________________ >> Flashcoders mailing list >> [email protected] >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

