Prevent undefined behaviour when drawing axis