Slide 21
Slide 21 text
Bresenham Line Algorithm
Update the method onPointerMove() in app.component.ts:
if (this.previousPoint) {
const currentPoint = {x: Math.floor(event.offsetX), y:
Math.floor(event.offsetY)};
const points = this.paintService.bresenhamLine(this.previousPoint.x,
this.previousPoint.y, currentPoint.x, currentPoint.y);
for (const {x, y} of points) {
this.context.fillRect(x, y, 2, 2);
this.previousPoint = currentPoint;
}
}
Paint
EX #5
Produktivitäts-PWAs auf Desktopniveau
Angular meets Project Fugu