I am developing a plugin to resize an artboard based on reference point.
It generally works well, but with edits that result in negative X or Y coordinates, the values in the properties panel do not match the values of bounds, artboardRect, etc. obtained with batchPlay.
What is the rule for calculating the same numbers as in the properties panel?
Remarks:
It can be resized or moved correctly using the artboardRect that the plugin gets
I got rulerOriginH via batchPlay and it was 0 both before and after resizing. No change
This is more difficult than I thought it would be; it seems necessary to capture the characteristic of Photoshop’s artboard feature.
When there is an artboard, the canvas size is basically controlled by Photoshop and cannot be freely changed by the user. If automatic canvas size is turned off, it can be changed manually
Photoshop allows negative values for artboard coordinates. (This can be typed in the properties panel, and is also generated by dragging)
When negative coordinates occur, Photoshop automatically stretches the canvas. How much it stretches is not known
When Photoshop automatically stretches the canvas, the properties panel remembers the origin. However, bounds, artboardRect, etc. forget, and the values are displayed differently
If you stretch the canvas by yourself and change the values of artboardRect accordingly and set them, the values will match
The artboard can be resized and translated by setting artboardRect
However, in the case of translate, the contents do not follow, so it is better to use Layer.translate
Layer.resize does not exist, and Layer.bounds is read only