I would like to add a new block at the bottom [Text Document Part].
I have tried:
Getting all children to block from root block
Calculating the maximum y by calling getBox method for every children block, adding y and height
Adding a block with X and Y based on the above calculation.
What I realized is getBox is returning position in editor space while addBlock requires input from screen space. How can I add a new block at the bottom of the Text Document?
Best Answer
O
Olivier @MyScript
said
about 1 month ago
shikang_neoh
Dear Shikang,
Thank you for contacting us and your question.
Currently, it is not possible to add a block at the top of a "Text Document" "a posteriori".
Indeed, blocks can only be added at the bottom of a "Text Document" or beside another block IF there is enough space left.
Indeed, adding a block at the top would imply moving all the previous blocks of the document, and would likely result in unexpected behaviors.
Shi Kang Neoh
Hi,
I would like to add a new block at the bottom [Text Document Part].
I have tried:
How can I add a new block at the bottom of the Text Document?
shikang_neoh
Dear Shikang,
Thank you for contacting us and your question.
Currently, it is not possible to add a block at the top of a "Text Document" "a posteriori".
Indeed, blocks can only be added at the bottom of a "Text Document" or beside another block IF there is enough space left.
Indeed, adding a block at the top would imply moving all the previous blocks of the document, and would likely result in unexpected behaviors.
You can also refer to the following topics, that give explanations how to properly use the "addBlock":
-https://developer-support.myscript.com/support/discussions/topics/16000028588
-https://developer-support.myscript.com/support/discussions/topics/16000027123
-https://developer-support.myscript.com/support/discussions/topics/16000030020
-https://developer-support.myscript.com/support/discussions/topics/16000024723
Best regards,
Olivier
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstShi Kang Neoh
Or is there any way I can convert from editor space to screen space?
Olivier @MyScript
shikang_neoh
Dear Shikang,
Thank you for contacting us and your question.
Currently, it is not possible to add a block at the top of a "Text Document" "a posteriori".
Indeed, blocks can only be added at the bottom of a "Text Document" or beside another block IF there is enough space left.
Indeed, adding a block at the top would imply moving all the previous blocks of the document, and would likely result in unexpected behaviors.
You can also refer to the following topics, that give explanations how to properly use the "addBlock":
-https://developer-support.myscript.com/support/discussions/topics/16000028588
-https://developer-support.myscript.com/support/discussions/topics/16000027123
-https://developer-support.myscript.com/support/discussions/topics/16000030020
-https://developer-support.myscript.com/support/discussions/topics/16000024723
Best regards,
Olivier