2 Replies Latest reply on Apr 13, 2011 3:26 AM by stoereee

    [JS IDCS5] changing geometricBounds

    stoereee Level 1

      When I change the geometricBounds of a frame (myFrame.geometricBounds = [0, 0, 100, 100]), the graphic within that frame is moving. I want to change these bounds, but the graphic inside has to stay at his position (x = 0, y = 0).

       

      Regards, Sjoerd

        • 1. Re: [JS IDCS5] changing geometricBounds
          stoereee Level 1

          I just noticed the graphic only moves when changing the geometricBounds of the frame when it is an inline frame!? It adds up the coordinates of the inline frame (relative to the page) to the graphic inside that frame.

          • 2. Re: [JS IDCS5] changing geometricBounds
            stoereee Level 1

            Solution:

            • save the geometricBounds of the frame
            • resize Frame
            • declare values of the saved geometricBounds
            • move the inline graphic backwards with the declared values

             

            Example:

            var myBounds = mySelection[i].geometricBounds;
            mySelection[i].geometricBounds = ["0mm", "0mm", "130mm", "130mm"];
            var myX = myBounds[0];
            var myY = myBounds[1];
            mySelection[i].graphics[0].move(undefined, [-myY, -myX]);
            

             

             

            Sjoerd