mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
14 lines
No EOL
367 B
JavaScript
14 lines
No EOL
367 B
JavaScript
import opts from './opts.js';
|
|
import { getData } from './data.js';
|
|
|
|
export function drawData(board) {
|
|
const ctx = board.getContext();
|
|
const data = getData();
|
|
board.clear();
|
|
ctx.clearRect(0, 0, opts.width, opts.height);
|
|
data.elements.forEach(ele => {
|
|
ctx.setFillStyle(ele.desc.color);
|
|
ctx.fillRect(ele.x, ele.y, ele.w, ele.h);
|
|
});
|
|
board.draw();
|
|
} |