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

bounds bug when moving artboards using extend script #360

Closed
canoztokmak opened this issue Jul 28, 2016 · 3 comments
Closed

bounds bug when moving artboards using extend script #360

canoztokmak opened this issue Jul 28, 2016 · 3 comments

Comments

@canoztokmak
Copy link
Contributor

canoztokmak commented Jul 28, 2016

Hey there,

Looks like there is very strange bug when moving artboard layers using extend script. Tried this on Photoshop CC 2015 and CC 2015.5.

Reproducing steps are listed below:
1- Retrieve document info, and output bounds value.
2- Displace it with a delta greater than 1024 pixels. (e.g. dx: 1024, dy: 0, or dx: 1024, dy: 1024)
3- Retrieve document info again, and output bounds value. It will be invalid.
4- Displace it back to its original position negating the delta used in previous step.
5- Retrieve document info again, and bounds value will show invalid values. (plus or minus 1024)

This behavior can be seen in the attached sample project.

Below are sample outputs I created using the sample project:

fetching documentInfo..
Initial bounds artboard {"top":0,"left":0,"bottom":1136,"right":640}
moving layer with delta {"dx":1024,"dy":1024}
fetching documentInfo again..
Intermediate bounds artboard {"top":0,"left":0,"bottom":1136,"right":640}
moving layer with delta {"dx":-1024,"dy":-1024}
fetching documentInfo again..
Final bounds artboard {"top":1024,"left":1024,"bottom":2160,"right":1664}

fetching documentInfo..
Initial bounds artboard {"top":0,"left":1,"bottom":1136,"right":641}
moving layer with delta {"dx":1024,"dy":1024}
fetching documentInfo again..
Intermediate bounds artboard {"top":0,"left":1,"bottom":1136,"right":641}
moving layer with delta {"dx":-1024,"dy":-1024}
fetching documentInfo again..
Final bounds artboard {"top":1024,"left":1,"bottom":2160,"right":641}

Initial bounds artboard {"top":1,"left":0,"bottom":1137,"right":640}
moving layer with delta {"dx":1024,"dy":1024}
fetching documentInfo again..
Intermediate bounds artboard {"top":1,"left":0,"bottom":1137,"right":640}
moving layer with delta {"dx":-1024,"dy":-1024}
fetching documentInfo again..
Final bounds artboard {"top":1,"left":1024,"bottom":1137,"right":1664}

Below is valid because the displaced artboard won't be beyond 1024 pixels. Initially, it was at (0,0).

fetching documentInfo..
Initial bounds artboard {"top":0,"left":0,"bottom":1136,"right":640}
moving layer with delta {"dx":1023,"dy":1023}
fetching documentInfo again..
Intermediate bounds artboard {"top":1023,"left":1023,"bottom":2159,"right":1663}
moving layer with delta {"dx":-1023,"dy":-1023}
fetching documentInfo again..
Final bounds artboard {"top":0,"left":0,"bottom":1136,"right":640}

But, if the it was initially at (1,1), displacing it (1023, 1023) will yield invalid output again. See intermediate bounds.

fetching documentInfo..
Initial bounds artboard {"top":1,"left":1,"bottom":1137,"right":641}
moving layer with delta {"dx":1023,"dy":1023}
fetching documentInfo again..
Intermediate bounds artboard {"top":0,"left":0,"bottom":1136,"right":640}
moving layer with delta {"dx":-1023,"dy":-1023}
fetching documentInfo again..
Final bounds artboard {"top":1,"left":1,"bottom":1137,"right":641}

sample.zip

@canoztokmak
Copy link
Contributor Author

any plans or roadmap for this bug ?

@timothynoel
Copy link

I believe you're seeing the results of "auto-expand" with artboards. When artboards are moved past a tile boundary (probably 1024 in your case) the document bounds are changed to make all the tiles that contain any layers/artboards visible. In addition, if the art board is moved past 0,0 (where the position would otherwise became negative), all the layers are moved down and to the right, to keep the document coordinates positive and everything in the doc. The top left of the visible canvas in Photoshop is 0,0 and needs to remain so for compatibility with existing plugins/scripts that assume the document bounds are positive. In general, the doc bounds are allowed to change as art boards are moved around.

@mcilroyc
Copy link
Contributor

Closing as answered. @canoztokmak let me know if tim's comment was insufficient, or if you think there is something else going on.

@mcilroyc mcilroyc removed their assignment Sep 27, 2017
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