Closed GoogleCodeExporter closed 8 years ago
With the current version of Crunchy (0.9.8+), an html canvas is created "on
demand"
when the graphics module is used. When executing code from an editor box,
there is
no way (a priori) to know that an html canvas has been created by previous code
execution. To find out whether or not an html canvas is displayed (so that it
can be
cleared) I believe that it would be required to either scan the DOM (using
javascript) or importing the graphics module *each* time the code from an
editor box
is executed. This would add an unnecessary step most of the time as it is a
rare
instance where a user will create graphics. When a user does create a graphics
using
an editor box, it will usually be the case that repeated execution will contain
graphics.
If/when it is not the case, it is possible to clear the graphics (but not
remove all
the "vertical space" where the graphics used to be) using init_graphics(0, 0).
To
simplify matters, I have created an equivalent function in the graphics module;
that
function is called clear_graphics().
I will leave this issue open for now (at least for a few days), giving Johannes
the
opportunity to comment - or close it himself.
Original comment by andre.ro...@gmail.com
on 25 Nov 2007 at 4:23
Original comment by andre.ro...@gmail.com
on 7 Dec 2007 at 9:36
Original issue reported on code.google.com by
johannes...@gmail.com
on 24 Nov 2007 at 11:27