rough-native
Version:
Create graphics using HTML Canvas or SVG with a hand-drawn, sketchy, appearance. Features comprehensive React hooks, memory management, and React 18 concurrent rendering support.
12 lines (11 loc) • 481 B
JavaScript
import { HachureFiller } from './hachure-filler';
import { CONFIG } from '../config';
export class HatchFiller extends HachureFiller {
fillPolygons(polygonList, o) {
const set = this._fillPolygons(polygonList, o);
const o2 = Object.assign({}, o, { hachureAngle: o.hachureAngle + CONFIG.FILL_PATTERN.CROSS_HATCH_ANGLE_INCREMENT });
const set2 = this._fillPolygons(polygonList, o2);
set.ops = set.ops.concat(set2.ops);
return set;
}
}