Skip to content
Discussion options

You must be logged in to vote

getCornerPoints returns an object in the following format:

{
    topLeftCorner: { x: ..., y: ... },
    topRightCorner: { x: ..., y: ... },
    bottomLeftCorner: { x: ..., y: ... },
    bottomRightCorner: { x: ..., y: ... },
}

The issue arises here:

resultCtx.beginPath();
resultCtx.moveTo(points.topLeft.x, points.topLeft.y);
resultCtx.lineTo(points.topRight.x, points.topRight.y);
resultCtx.lineTo(points.bottomRight.x, points.bottomRight.y);
resultCtx.lineTo(points.bottomLeft.x, points.bottomLeft.y);
resultCtx.closePath();
resultCtx.stroke();

It should be points.topLeftCorner.x instead of points.topLeft.x. You'll need to fix all occurrences of this issue.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@Antonio-Lucian-Popa
Comment options

@Antonio-Lucian-Popa
Comment options

@ColonelParrot
Comment options

@Antonio-Lucian-Popa
Comment options

@ColonelParrot
Comment options

Answer selected by ColonelParrot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants