Page 1 of 1

Issue with getPosition() of text entity

Posted: Fri Jun 22, 2018 12:59 pm
by sarlaa
Hi,

I have an issue with getPosition() of text entity with this scenario :
I add a text with : position X
I move it to : position Y
and then I do undo : I ask for position, and I get position Y !! while I see in their proprties position X as expected.

It's look like to mee that when I ask for position, it dosen't take the new value or it needs a refresh.

Thanks.

Re: Issue with getPosition() of text entity

Posted: Fri Jun 22, 2018 2:45 pm
by andrew
Could it be that you are working with a copy of the entity, not the real entity? Make sure that you query (re-query) the entity from the document based on its ID.

document.queryEntity(..) always gives you a copy of an entity. That copy does not reflect changes in the drawing. Also, modifying that object has no effect on the drawing (without going adding it to an operation, etc).