>we can add radius 24(48/2),display will be right void checkEdges() { if (position.x > width + 24) { position.x = 0; } else if (position.x < 0 - 24) { position.x = width; } if (position.y > height + 24) { position.y = 0; } else if (position.y < 0 - 24) { position.y = height; } }
}