I have an active ArtLayer
referenced by the variable NewLayer
that I want to move to the absolute position x,y in the canvas.
I have been googling for a couple of hours now without any results. Can some one please give an example?
// Thanks.
Hold shift key at same time in order to rotate in exact 15 degree increments. Move the photo by dragging the mouse over the photo until you see the solid arrow in the center of the photo. Click and drag photo to desired position.
Choose Layer > Arrange, and then choose Bring To Front, Bring Forward, Send Backward, or Send To Back.
Tip: The shortcut key for the Move Tool is 'V'. If you have the Photoshop window selected press V on the keyboard and this will select the Move Tool. Using the Marquee tool select an area of your image that you want to move. Then click, hold and drag your mouse.
After some more API reading and searching I came to the conclusion that it is only possible to move a layer with delta move.
I wrote this little function to position a layer at an absolute position. Hope this is helpful to the next reader with the same question...
//******************************************
// MOVE LAYER TO
// Author: Max Kielland
//
// Moves layer fLayer to the absolute
// position fX,fY. The unit of fX and fY are
// the same as the ruler setting.
function MoveLayerTo(fLayer,fX,fY) {
var Position = fLayer.bounds;
Position[0] = fX - Position[0];
Position[1] = fY - Position[1];
fLayer.translate(-Position[0],-Position[1]);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With