![](https://secure.gravatar.com/avatar/bb65b6b3a109d97cf9f8d6c014ede042.jpg?s=120&d=mm&r=g)
On 10/24/07, Gerrit . <g99k@...19...> wrote:
I am sorry to bother you again with this, but I couldn't find the right method to retrieve the item's coordinate origin I was referring to. Maybe someone can point me to the right functions again?
I guess to get the origin, you just need to take NR::Point(0,0) and multiply it by that item's accumulated transform. To get the latter, use sp_item_i2doc_affine and convert it to desktop coords with matrix_to_desktop (that's offhand, not tested).
What I want to achieve is that a small dot appears at the translation x and y coordinates of the selected item's global transform. So, if the item is newly created, it would be at (0,0) at the upper left corner. When you drag the item around, the point gets dragged too, but it doesn't change when you scale or rotate.
That's impossible. When you scale or rotate, you change the matrix and thus the position of the origin too, unless you scale or rotate it around that origin. Looks like you need something else.
Then, I'm not very good with C++ pointers. I couldn't find a way to access the numbers that make up the NR::Matrix.
I think you need matrix.c[number], or look up in the transformation dialog, transform tab, how that code extracts the values.
I tried to use NR::Matrix::copyTo to copy the values to a Coord array, but I still don't even know how to pass the Coord values to the NR::Point constructor or printf functions.
It's just double. Read the .h files in libnr/ for details.