* web/commons/canvas_helpers.ml: factorized more