Rotation issue - pointing at a certain point

So, I have code here for rotation of an entity. This is on LIBGDX, if that’s important.

rotation.degrees = (MathUtils.atan2(pos.y - position.y , pos.x - position.x) * MathUtils.radiansToDegrees) - 90;

where pos is the position of the mouse, and position is the entity’s position. The strange thing is that atan2 is returning incorrectly or something, since the values I’m getting are NOT what I need. It’s like, the more I go along the X or Y axis, the more it rotates, but only within 90 degrees or something like that.

What am I doing wrong? I’ve looked up several solutions and every single one pointed to this code, or a variant thereof.

EDIT: I fixed the problem. It turns out that it was not a calculations problem, but rather a rendering problem - I didn’t account for the rendering system’s offset.