Skip to content

Commit

Permalink
refactor: remove unneeded draw car segment method [#1]
Browse files Browse the repository at this point in the history
  • Loading branch information
d3p1 committed Nov 4, 2024
1 parent 2818ba5 commit e21c25e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions docs/js/core/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,22 +201,11 @@ export default class Car {
context.beginPath()
context.moveTo(this.polygon[0][0].x, this.polygon[0][0].y)
this.polygon.forEach((segment) => {
this.#drawCarSegment(context, segment)
context.lineTo(segment[1].x, segment[1].y)
})
context.fill()
}

/**
* Draw car segment
*
* @param {CanvasRenderingContext2D} context
* @param {{x: number, y: number}[]} segment
* @returns {void}
*/
#drawCarSegment(context, segment) {
context.lineTo(segment[1].x, segment[1].y)
}

/**
* Build car polygon
*
Expand Down

0 comments on commit e21c25e

Please sign in to comment.