I use CAD a lot. I also use LC a lot as a drawing program. I know it is not intended for this.
I needed to take a "stock" polygon graphic:
and be able to continuously stretch it in either x or y under script control. No problem, I simply increased, say, the width of the graphic until it was the right size. But in doing so, the small horizontal segment at the botRight stretches proportionately:
When what I want is this:
I am able to get the bottomMost version in two ways, by simply increasing the width and adjusting the length of that trailing segment on the fly, or by changing the points of the graphic explicitly, as the stretching process runs.
But is there a way to simply stretch? I originally had thought that by, say, doubling the width of the starting graphic, that the "ends" would stay the same. In fact, doing so doubles the size of any and all horizontal elements. Fortunately it does not increase the line width. This is not really unexpected, as, after all, an angled graphic changes its angle as the width changes.
Just wondering...
Craig
Stretching graphics
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Stretching graphics
Assuming it's a continuous line drawn from the left to the right, you could take the points, and find the difference between the left and right ends of the segment you want to extend. Say that is 100 in the horizontal direction and you multiply by 2, then you can just change the x coordinate of the right end, and the x coordinate of the beginning of the next segment.
More complicated shapes might be rather trickier.
More complicated shapes might be rather trickier.
-
- VIP Livecode Opensource Backer
- Posts: 9729
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Stretching graphics
Sparkout.
That is pretty much what I did.
I guess I was really asking if that behavior made sense, in that doubling the width of a control also doubled the width of all horizontal segments as well. I was not sure that is consistent with my perception of what changing the width really means, that is, that doing so proportionately "expands" the segments that comprise that graphic, as opposed to simply making the original "shape" twice as wide.
I do see it, though.
Craig
That is pretty much what I did.
I guess I was really asking if that behavior made sense, in that doubling the width of a control also doubled the width of all horizontal segments as well. I was not sure that is consistent with my perception of what changing the width really means, that is, that doing so proportionately "expands" the segments that comprise that graphic, as opposed to simply making the original "shape" twice as wide.
I do see it, though.
Craig