JAL-192 JAL-2099 factored out calculation from rendering code #2