agilgur5 / agilgur5/trim-canvas

Add optional arg to duplicate / clone canvas

未关闭
#6 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
feature
主要语言
JavaScript
星标
74
派生
5
PR 合并指标
30 天内没有已合并 PR

描述

i.e. `trimCanvas(canvas, {duplicate: true})`.

Given the intense demand seen by the number of upvotes on https://github.com/szimek/signature_pad/issues/49#issuecomment-260976909 it seems like it should be included by default.

I'm also reading through my own docs for the first time in a while and if you don't know how canvas or cloning works, it may be quite unintuitive.

It's only a handful of lines of code, but IIRC the reason why I didn't include it (or removed it rather) was because it introduced a dependency on `canvas`, meaning it wouldn't work in Node (requires a pretty massive native dependency). If it's hidden behind an optional flag though, this shouldn't be problematic.
This is something I've been thinking of adding for a while (in my backlog, ofc), but I also happened to see https://github.com/lukechilds/merge-images#nodejs-usage today, which is another interesting workaround for Node usage.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。