* web/commons/canvas_helpers.ml: factorized code there