Drawing Pan bars using the rectangle class?

Hi everyone, I’m building my first Audio Plugin and I’d like to add two bars for the pan of left and right channel. I’ve managed to draw two rectangles which change height continuously but only in a top-down fashion (as the rectangle is drawn in that way I guess). How can I draw the rectangles in the opposite direction?

given barHeight is the height of the bar you want to draw, and totalHeight is the total height of the “meter” :

int topPositionOffset = totalHeight - barHeight;

now you can draw a rectangle using the top position you want + the offset with a height of barHeight, this will keep the bottom in place and move the top accordingly.