Skip to main content
JtotheILL
Participating Frequently
May 17, 2019
Question

resize from center of canvas

  • May 17, 2019
  • 2 replies
  • 1389 views

I have searched and searched but cant seem to find the answer. 

I have an photoshop file that is comprised of a few layers.  I need to resize all the layers so that the object is smaller.  I am using the following line of code and it does the trick, but the layers no longer align.  It appears that the anchorPosition.MiddleCenter uses the extents of the pixels on a particular layer.  I need the item to be resized using the canvas center so that when all the layers are resized, they stack on top of one another.   How do i set the anchor point to use canvas center?

activeDocument.activeLayer.resize(23,23, AnchorPosition.MIDDLECENTER);

This topic has been closed for replies.

2 replies

JJMack
Community Expert
Community Expert
May 18, 2019

If you reduce a layers size frome its center. Its centel position should not change relative the it current canvas location.  That alignment should not change.  If you change a layer size some thinsg move relative to the canvas

JJMack
Legend
May 17, 2019

Select all the desired layers and execute your command.

JtotheILL
JtotheILLAuthor
Participating Frequently
May 19, 2019

I'll give that a try.  Thanks for the reply.

  Jill Goodson

Creative Director

[personal information removed for your protection - https://forums.adobe.com/docs/DOC-3731]

[This is a public forum, not Adobe support, please do not post personal information]

[If you are posting using email, please turn your 'sig file' function OFF for posting]