UNPKG

541 BSource Map (JSON)View Raw
1{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/util/context.ts"],"names":[],"mappings":"AAAA,IAAI,GAA6B,CAAC;AAElC;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,GAAG,EAAE;QACR,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KACzD;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["let ctx: CanvasRenderingContext2D;\n\n/**\n * 获取 canvas context\n */\nexport function getCanvasContext() {\n if (!ctx) {\n ctx = document.createElement('canvas').getContext('2d');\n }\n\n return ctx;\n}\n"]}
\No newline at end of file