Jealousy doesn't always come from "liking" someone (let's call that someone Alice). It comes from wanting to be liked by Alice. And if Alice spends her affection on Bob, and you become jealous by seeing them being cuddly, it doesn't mean that you like Alice. It just means that you want to be in Bob's place.
If you move from wanting affection and compassion (the "inwards") to expressing it towards other people ("outwards"), you can become even happier than if you've been pampered by Alice.
Romantic feelings have nothing to do with this situation at all.