Car diagonal facing

hey i made a car, that moves in 8 directions. how do i make it, so if both up and right are pressed the car faces diagonal?

i got this:

if(Key.isDown(Key.RIGHT) && (Key.UP)){
_rotation=45;
}

but it doesn’t work.