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

layer.bounds error

$
0
0

Hi all,

 

I'm trying to export layer centers to an xml.

 

the following code works fine for all cases, except one.

 

var curr_layer = app.activeDocument.activeLayer;

var layer_bounds_centerX = curr_layer.bounds[0].value;

var layer_bounds_centerY = curr_layer.bounds[1].value;           

alert("Layer Bounds  : (" + layer_bounds_centerX + " ," + layer_bounds_centerY + " )");

 

in that special case the bounds are upside down in the y direction.

 

meaning : doc size is 6000x4500

instead of having the layer_bounds_centerY at around 4000 (bottom down texture)

it shows  layer_bounds_centerY to be 500.  (it should be 4500 - 500 )

the layer_bounds_centerX is correct.

 

anyone know why this happen?

Thanks!

 

p.s :

how to attach the psd file?

 

thanks!


Viewing all articles
Browse latest Browse all 12244

Trending Articles



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