Closed stephenrparsons closed 9 years ago
that is because drawopacity doesnt really draw anything. it returns a function that draws something. rename drawopacity to makedrawfn or something less confusing, and in this case use it like:
mydrawfn = makedrawfn(true, true);
addEventListener("foobar", mydrawfn);
What would be the best approach to have a draw() function that could be called anywhere and would do what we expect? That would be quite handy.
can you be more specific about what you expect?
the point of manufacturing the function like this is that the drawfn will vary (slightly) depending on whether you want to redraw the primary canvas and whether it should (can) update the last known position of the mouse.
Check if my last commit fixed it.
Yeah, that makes more sense to me now. Silly me hadn't registered that it was returning a function, which is clear, I just wasn't paying attention. Thanks for comments too, cleared it up significantly for me.
On Sun, Apr 12, 2015, 6:45 PM john walker notifications@github.com wrote:
Check if my last commit fixed it.
— Reply to this email directly or view it on GitHub https://github.com/viscenter/layered-viewer/issues/19#issuecomment-92146050 .
ok cool. if you think there is a descriptive function name in particular that you want, i'm totally open to not doing things like makedrawfn(true,true)({}) or whatever. it's just that the names i could think of were things like
forceredrawandupdatemouseposanddrawthingy(e)
dontforceredrawandupdatemouseposanddrawthingy(e)
.
.
.
Right now it does not change the shape until the mouse is moved. The switch does call drawopacity() so I am not sure why the update is not instant.