My personal opinion is that you should tell her (at least something), before you ask her to marry you.
If your past did not affect you now, then I would say that it was okay to leave it in the past and keep your mouth shut.
But, as you have stated, you are affected by the past (which by the way is completely normal, and nothing to berate yourself over), then it will affect her too in your married life. Secrets of any kind eat away at us, and keeping secrets is not the best foundation for a marriage. Secrets also put a heck of a lot of pressure and added stress on you. You shouldn't have to hide who you really are from her. All your past experiences make you who you are today, that includes 'the good, the bad, and the ugly'. Learn to trust each other 100% before committing to marriage. If you are going to have a long and happy future together, then I personally think she needs to see all sides of you.Having a life long partner isn't just about the good times, it's about looking after each other, and supporting each other through the bad times too.
I do believe it is better to open up now, than to wait until after you are married. Sometimes even the best people can't handle certain situations. Personally I'd rather know that now, than in a few years time. Equally, if she truely loves you, and knows you well, she probably has an idea that maybe you are not 100% happy, 100% of the time, and she's maybe just waiting for you to open up.
I'm not suggesting that you tell her everything, all at once. Sometimes, just the basics is all that is needed to 'test' the waters. Like Lucy said, maybe just the basic idea, not all the details, and see where that leads you.
There is a small chance that it could lead to rejection, but I seriously think you would be better off knowing now, than a few months or years down the track. Much more likely, is that you will have a much stronger foundation of mutual trust, and support on which to build on over your future years together.
I don't deny that it's a bit of a gamble, but honesty now, means that you can be yourself in years to come, and not have to hide your depression or anxiety over certain situations.
Just my opinion.
Whatever you decide, I wish you well ;)