Open zcleghern opened 6 years ago
I think that what's happening here is that you're trying to draw on the canvas before it is fully loaded. I'm not entirely sure how to fix it though, seeing as threepenny-gui doesn't seem to obviously provide any sort of onload
event.
I'll play around with this, but thanks!
I can't seem to draw the image unless i have the code in the same place as the example code i.e. drawing an image when the user presses the corresponding button (also it seems to be off-center no matter what x y values I supply)
I'm having an issue with canvases. I have modified the Canvas.hs example program to draw an image onto the canvas with
canvas # drawImg
right after the canvas setup code; here it is for reference:
where drawImg is
which should be the same behavior as the on click function for drawing an image in the original version of the code.
The actual behavior of this code is a blank canvas, just as in the original example. Why is this? Should I instead add this call to the line that sets up the canvas? I'm guessing most likely my problem is that I need to understand do notation better.