If you can lay your hands on an NFPA-13, you will find your answer in there. No violation on a flush fixture (should not be touching though), and basically the 3X rule is correct except that your need to use the dimension which gives you the greater rating of depth or width.
You will find your dead on answer in NFPA-13, chapter 8, section 8.7
I know that's confusing, but it depends on exactly what you have there. I was looking up the answer for you when my FPE looks over my shoulder, and he came up with the same answer, so maybe for once both of us are right.