1 Reply Latest reply on Dec 27, 2011 8:33 AM by mlavie

    TransformationMatrix Ignoring its Methods

    mlavie Level 1

      For CS5, ActionScript, Win7

       

      Hi all,

       

      I am encounteruing very strange behavior with the TransofrmationMatrix object.

       

      If I initiate the TransformationMatrix object with all its values when I create it with app.transformationMatrices.add(2,2,0,0,0,0), then it does exactly what I expect (i.e., double the size of the PageItem). However, if I do not supply any parameters and then call myTransformationMatrix.scaleMatrix(2,2), then nothing happens. And yes, I did verify that the rectangle I'm working with exists and is valid, etc.

       

      i.e., this works

       

         var app:Application = InDesign.app;

        

         var selectedRectangle:Rectangle = ((app.selection as Array)[0] as Rectangle);

        

         var scaleMatrix:TransformationMatrix = app.transformationMatrices.add(2,2,0,0,0,0);

         selectedRectangle.transform(CoordinateSpaces.PASTEBOARD_COORDINATES, AnchorPoint.CENTER_ANCHOR, scaleMatrix );

       

      But this doesn't work:

       

         var app:Application = InDesign.app;

        

         var selectedRectangle:Rectangle = ((app.selection as Array)[0] as Rectangle);

        

         var scaleMatrix:TransformationMatrix = app.transformationMatrices.add();

         scaleMatrix.scaleMatrix(2, 2);

         selectedRectangle.transform(CoordinateSpaces.PASTEBOARD_COORDINATES, AnchorPoint.CENTER_ANCHOR, scaleMatrix );

       

       

      Anyone else encounter this or have any ideas?

       

      TIA,

      mlavie