Passive losses and capital gains on sale of rental property

I sold a piece of rental property this year.  I bought it in 2016 for 270K and sold it for $380K.  Every year that I owned it, I showed a passive loss on the property.  That passive loss was non-deductible.  So, basically, I had to declare depreciation but not get to deduct it.  I know that I have to deduct depreciation from my basis when calculating capital gains. So, how does the passive loss work?  Do I get to add it back into my basis when calculating the capital gains on the rental property?  Thanks.

 

David