Getting scrollX, Y of canvas?

Hi,
how to find out scrollX,Y of canvas/document?

Thank you

For now like this:
image

This is 2D transformation matrix. It includes zoom, pan, rotation and flip. You can google articles on how to calculate the part you need to.

Later we hope to add proper DOM API. The problem is that same document can have multiple windows and each window different view settings and this value in document class does apply only for the active window. So this requires some extra work to do it right at the first try :slight_smile:

2 Likes

Thanks for answer!
I tried
console.log( app.activeDocument.viewTransform)

but it is always “undefined” - any idea?

It is not in DOM yet. You need to use batchPlay code for now.

1 Like

super. works great - Thank you!