Yes; you would still be entitled to compensation in this case. The operating airline is always responsible for any delays, even when the flight tickets weren’t purchased directly with them.

However: if your travel agent decided to re-book you on another flight but the original flight was operated on time you are not entitled to receive compensation, because in that case the airline cannot be held responsible for the delay you experienced.