Are they in the shade and leaning towards the light Rosemary? A photo would be good
If both sides are "growing sideways" I would wait until flowering is over and cut back.....
Not too hard, into old wood, but enough to give a good trim.
My own lavendar hedge.....30'....was put in 18 months ago and currently burgeoning with flower. I will cut mine by half after flowering