Interactive Ink

Bounding Box Coordinates

I'm having issues with bounding box coordinates. I can draw the appropriate boxes, but they are in the wrong locations.  I understand that iPad renders at 3X, but i'm still having issues with it. Is there some factor I need to scale the coordinates by?

here's the jiix export

jsonText String?? "{\n \"type\": \"Container\",\n \"id\": \"RootBox\",\n \"bounding-box\": {\n \"x\": 31.557579,\n \"y\": 32.326,\n \"width\": 156.2485,\n \"height\": 73.888\n },\n \"children\": [ {\n \"type\": \"Text\",\n \"bounding-box\": {\n \"x\": 31.557579,\n \"y\": 32.326,\n \"width\": 89.284859,\n \"height\": 9.2360001\n },\n \"label\": \"melo\",\n \"words\": [ {\n \"label\": \"melo\",\n \"candidates\": [ \"melo\", \"Melo\", \"meto\", \"Meto\", \"helo\" ],\n \"bounding-box\": {\n \"x\": 32.374466,\n \"y\": 34.023262,\n \"width\": 10.9459,\n \"height\": 6.7558365\n },\n \"range\": \"[5:0,8:3$]\",\n \"strokes\": [ ]\n } ],\n \"id\": \"1\"\n }, {\n \"type\": \"Text\",\n \"bounding-box\": {\n \"x\": 31.557579,\n \"y\": 96.978004,\n \"width\": 156.2485,\n \"height\": 9.2360001\n },\n \"label\": \"hello\",\n \"words\": [ {\n \"label\": \"hello\",\n \"candidates\": [ \"hello\", \"Hello\", \"hella\", \"helle\", \"Hella\" ],\n \"bounding-box\": {\n \"x\": 32.374466,\n \"y\": 98.67527,\n \"width\": 10.715004,\n \"height\": 6.7558365\n },\n \"range\": \"[14:0,18:3$]"... some

1 Comment

Dear Ethan,

currently, in the iink editor, you provide input in pixels, while the iink internally uses mms, which is also the unit in the JIIX export. You should then use the viewTransform, as epxlained in other topic:

Best regards,


Login or Signup to post a comment