Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How to get the dimensions of the content of a smart object?

$
0
0

I have a scaled smart object and I'm trying to make a calculation in my script using the bounds of the smart layer vs the bounds of the content inside the smart layer, so I can add text proportionally outside of the smart layer and have everything line up properly. Is there a good method for determining the dimensions of a smart layer's content?

 

destX = myLayer.bounds[0] + origX * ((myLayer.bounds[2]-myLayer.bounds[0])/8793);

destY = myLayer.bounds[1] + origY * ((myLayer.bounds[3]-myLayer.bounds[1])/4990);

 

This is the calculation I'm using where I know the content inside the smart layer is 8793x4990, but what's the best approach to not hard code this?


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>