Issue with getPosition() of text entity

Discussion forum for contributors and developers who are using the QCAD ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Post Reply
sarlaa
Active Member
Posts: 47
Joined: Mon Aug 28, 2017 4:39 pm

Issue with getPosition() of text entity

Post by sarlaa » Fri Jun 22, 2018 12:59 pm

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.

User avatar
andrew
Site Admin
Posts: 5702
Joined: Fri Mar 30, 2007 6:07 am

Re: Issue with getPosition() of text entity

Post by andrew » Fri Jun 22, 2018 2:45 pm

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).

Post Reply

Return to “QCAD Developers and Contributors”