Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text layer is moved after replacement and cannot be set to the original position. #71

Open
dirk-ns opened this issue Jul 15, 2021 · 2 comments

Comments

@dirk-ns
Copy link

dirk-ns commented Jul 15, 2021

Hi,
The text is set around a circle. If this is replaced, the position of the layer moves. A return to the old position does not work.
Here is an example file
test.zip

@loonghao
Copy link
Owner

loonghao commented Jul 18, 2021

Hi @dirk-ns
I have test with javescript have same issue
test

var doc = app.activeDocument;
var layer = doc.activeLayer;
layer.textItem.contents = "test string";

You may need to go to the Adobe Photoshop community to consult.

Sorry~

@bit-pete
Copy link

I found this issue too.
So, I set layer's position equal to start Position - different Position

var layer = doc.activeLayer;
startPosition = layer.textItem.position;
layer.textItem.contents = "test string";
lastPosition = layer.textItem.position;
if lastPosition != startPosition:
   layer.textItem.position = [startPosition[0]+startPosition[0]-lastPosition[0],startPosition[1]+startPosition[1]-lastPosition[1]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants