Transformation matrix - AnchorPoint does not work with horizontal/verticalTranslation

Dear forum,

When I try to use an AnchorPoint with horizontal/verticalTranslation property, it is ignored. It seems that AnchorPoint.TOP_LEFT_ANCHOR is always used when I use a different option: for example AnchorPoint.BOTTOM_RIGHT_ANCHOR.

In the example below, I tried to use all available anchor points, tried to play with other spaces of contact information, but the result is always the same: the m crept in the user interface, I put X 50pt with anchor top left selected.

main();

function main() {
    var doc = app.activeDocument;
    var obj = doc.rectangles[0];
    
    var transMatrix = app.transformationMatrices.add({horizontalTranslation: 50});
    obj.transform(CoordinateSpaces.PASTEBOARD_COORDINATES, AnchorPoint.TOP_LEFT_ANCHOR, transMatrix);        
}

However, with all of the other properties:

clockwiseShearAngle

counterclockwiseRotationAngle

horizontalScaleFactor

verticalScaleFactor

It works as expected

I'm doing something wrong? Am I missing something? Or, is this just a bug?

Kind regards
Kasyan

P.S. Forgot to mention: I'm on InDesign CC 2014 (2nd exit) for Windows.

Hi Kasyan,

There would be much to say here, but I don't have the time to explain in depth, so just keep in mind that the setting of the transform method is nothing more than a temporary location that provides the origin of the transform to apply. This original plays an important role in implementing SCALING and ROTATION effects, but it has no effect on the TRANSLATION component.

MyObj.transform (inSpace, fromOrigin, withMatrix, replacingCurrent) aims to change the State of transformation of myObj. As the initial state, he considers that the mapping of the matrix of myObj from inSpace, M, then it calculates something like M×T, where T represents essentially the desired transformation (withMatrix), but the real components are dealt with internally in order to take into account fromOrigin and replacingCurrent. ReplacingCurrent indicators specify if certain components must be treated as new values or operands. Finally, the refined plan of myObj is updated accordingly.

It would be wrong to think that the TRANSLATION components reflect the location of the object in the space of the sovereign. When you need reach a certain place through a translation, always calculate the parameters [tx, ty] as compensation. This is what is done here move object by "Point of reference" (as mentioned by tpk1982).

@

Marc

Tags: InDesign

Similar Questions

Maybe you are looking for

  • reprogramming UltraMax more on MacbookPro

    I have a UltaMax Plus (1 TB, desktop hard drive) which shows that on my MacBook Pro. I am unable to initialize it. How can I do that. Help, please.

  • Satellite P300-1 has 8 - part number for the AC adapter / CC

    Hello. Can anyone tell me the part number of the AC adapter I need to buy for my Satellite P300-1 c 8?Model No.: PSPCOE-01H008EN 15550 / 1024/1024/160 G 54/17W + BT/D52/L/M/L The toshiba site list or recognize the model, CarPhone Warehouse does not p

  • Registration - serial number problem

    Hello! Today I bought the PC Toshiba laptop (Satellite A350D).When I wanted to record everything was fine, but I accidentally entered the wrong date. When I try to change an error appears on her already registered the serial number. Now, I can't comp

  • Problem of time synchronization in the HP b2600 workstation.

    We have three Hp b2600 named rop11, rop12, rop13. rop11 is active and rop12 is passive and rop13 is autonomous. ROP's time synchronized with the GPS clock. But we face a problem of time synchronization. As we sychnisied a day after we saw a drift of

  • continues to fall sharply the internet connection for the computer but the xbox is not yet

    If the computer is on and I walk for an hour or two, when I come back, the internet connection went only to the computer. Xbox live still works fine.  So, I have to unplug the router, then plug back in and then try again to connect.  Usually it works