Text Shape Changes Don't Apply Unless I Click On The Canvas

141 views
Skip to first unread message

Gary Stimson

unread,
Oct 20, 2016, 7:13:29 AM10/20/16
to Literally Canvas
Hi,

I have an instance of the Litterally Canvas object inside a dialog. All shapes work perfectly and when I call "lc.getSnapshot()" on the OK button of the dialog I get the latest markup. However when I use the Text control the lc.getSnapshot() call does not contain the updated text unless I first click off of the text control onto the canvas and then click the OK button.

Therefore is there a way to trigger the text control to draw from the OK button (kind of doing what clicking on the canvas does) or at the very least as a fall back detecting that there is a control not drawn yet?

Thanks,
Gary

Steve Johnson

unread,
Oct 20, 2016, 12:57:13 PM10/20/16
to literal...@googlegroups.com
You could call lc.tool.commit(lc). That would make the text tool save your changes.

You might need to do a couple null checks; I don't remember if other tools have a commit() method. Probably not.
--
You received this message because you are subscribed to the Google Groups "Literally Canvas" group.
To unsubscribe from this group and stop receiving emails from it, send an email to literallycanv...@googlegroups.com.
To post to this group, send email to literal...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gary Stimson

unread,
Oct 26, 2016, 7:45:49 AM10/26/16
to Literally Canvas
Thanks for the reply.

Worked perfectly :)

Thanks,
Gary

Jasbir Sandhu

unread,
Sep 11, 2018, 6:06:09 AM9/11/18
to Literally Canvas

Screenshot (5).png

Can you please tell me how to use lc.tool.commit(lc)  as this is trowing error at my end. 

Harun Bicakli

unread,
Jul 1, 2021, 4:59:43 PM7/1/21
to Literally Canvas
Hi, how could you fix the issue. i don't know where to place lc.tool.commit()
Thank you

Reply all
Reply to author
Forward
0 new messages