[Ipe-discuss] How can I scale a rectangle only in length and preserve its width?

Otfried Cheong otfried at ipe.airpost.net
Tue Jan 17 03:30:59 CET 2012


On 01/16/2012 09:22 PM, Tim Hutt wrote:
> Yes. If I understand you correctly.
>
> 1. Turn on snap-to-vertex or snap-to-edge and hover over the top edge
> of the rectangle.
> 2. Press F1
> 3. Press E (stretch)
> 4. Left-drag down the vertical green line.
>
> Actually I just tried this and noticed (what I think is) a bug: If you
> start your drag quite far down, away from the rectangles, they can
> suddenly doubled in width. That shouldn't happen should it?
>
> Ah, I guess the procedure I described wasn't really intended to work,
> and it is trying to scale by 0/0 in the x direction.
>
> It might be nice to add something like this to the scaling code:
>
> if (xPos == xStartPos&&  angleSnap)
>     xScale = 1
>
> Actually that might be tricky to get right given the way scale behaves.
>
> Anyway, a more robust way to do this:
>
> 1. Turn on snap-to-vertex or snap-to-edge and hover over the top edge
> of the rectangle.
> 2. Press F1
> 3. Press F8 to turn off angle-snap.
> 4. Press F7 to turn on snap-to-grid.
> 3. Press E (stretch)
> 4. Left-drag down, to the right of the vertical green line, below the
> rectangles.

If you are willing to use the grid, you don't need the coordinate system 
at all.  Just turn on grid snapping (F7), stretch mode (E), and click 
somewhere near the bottom right of the rectangle.  Moving the mouse up 
or down on the same grid line will change the height, but not the width.

Of course this will change the height in discrete steps.

The continuous solution above (setting the coordinate system and then 
moving the mouse along the vertical coordinate axis) doesn't work 
correctly because of rounding errors.  I'll work around that in the next 
release.

Cheers,
  Otfried



More information about the Ipe-discuss mailing list