this is in java, drawing on a canvas inside of a jframe
Coding an asteroids game here. The problem is with the asteroids currently. they function normally until they hit a boundary of the drawing area. At this point they tend to stick to the boundary and move along it or suddenly stopping. I've looked at the positions of the asteroids, and they are not changing as they should be when the asteroid gets stuck. Also, they do not get stuck on the right and bottom borders, where the drawing surface does not quite meet the edge of the jframe for some reason. I'm not putting up any code atm, just checking to see if i can get any quick answers, i'll give code when there does not seem to be an easy solution.
Note: the player controlled ship moves around perfectly fine, not attaching to any walls or anything weird when it moves fast, but when the ship is moving slowly it gets stuck to the wall.
I've racked my brains and cannot come up with a solution

Going to make a video of this I think.