Legend
Nov 1, 2026 5:10 PM UTC
Answered
How is the width "W" value of the image on the control bar calculated?
- 16 replies
- 65 views
- Translate
After copying the same image and rotating it by 10 degrees, the "W" value on the control bar does not change, and the rotated W is not obtained using gb [3] - gb [1].
I found a script that should be correct in principle, but it will mention 'undified':
var d = app.activeDocument;
var item = app.selection[0];
//No rotation, obtain directly from the boundary
var gb = item.geometricBounds;
var width = gb[3] - gb[1];
// If the object has rotation, use transformValues to obtain the actual size
var tv = item.transformValuesOf(CoordinateSpaces.INNER_COORDINATES);
var w = tv.horizontalScale;
var h = tv.verticalScale;
alert(w);
