Thank you for your suggestion, but I’m really just drawing simple rectangles… But I do a lot of computation for the size of the rectangles, since it must be resizable and also depending from the components size…
So I do things like that for computing the width of the meterse.g.:
const float meterWidth = ceil((getWidth() - scaleWidth - meterSpacing * (levels.size()-1)) / levels.size());
The lines are leftovers of the background rectangles, which have the colors of the visible meters. The meters theirselves are drawn over this background in the color of the parent component’s background to indicate the actual audio level. I think this is a common way to do these kind of things.
The interesting point for me is that the computation of the width of the background rectangles and the foreground rectangles (the actual always repainting levels) are computed the same, see above. Also their X-coordinate is the same. There are also no issues at all if I don’t use a Retina display.
I also tried drawing the rectangles with fixed values such as 15.0f for the width for example. Same result. So i guess, it must depend that I use fillRect with float values? Does it somehow behave differently on a Retina display maybe?