mirror of
https://github.com/rough-stuff/rough.git
synced 2026-01-15 01:18:26 -05:00
30 lines
928 B
JavaScript
30 lines
928 B
JavaScript
import { RoughCanvas } from './canvas';
|
|
import { RoughGenerator } from './generator';
|
|
import { RoughGeneratorAsync } from './generator-async';
|
|
import { RoughCanvasAsync } from './canvas-async';
|
|
import { RoughSVG } from './svg';
|
|
import { RoughSVGAsync } from './svg-async';
|
|
export default {
|
|
canvas(canvas, config) {
|
|
if (config && config.async) {
|
|
return new RoughCanvasAsync(canvas, config);
|
|
}
|
|
return new RoughCanvas(canvas, config);
|
|
},
|
|
svg(svg, config) {
|
|
if (config && config.async) {
|
|
return new RoughSVGAsync(svg, config);
|
|
}
|
|
return new RoughSVG(svg, config);
|
|
},
|
|
createRenderer() {
|
|
return RoughCanvas.createRenderer();
|
|
},
|
|
generator(config, surface) {
|
|
if (config && config.async) {
|
|
return new RoughGeneratorAsync(config, surface);
|
|
}
|
|
return new RoughGenerator(config, surface);
|
|
}
|
|
};
|