How to crop component without changing size?

Hello,
I wonder if is there any juce method to simply crop the component.
It seems to me like something obvious, but I can’t find anything about that in juce documentation.
setBounds at first looks like method that I am looking for, but unfortunately it also change the size of component.

I want to be able to zooming my component, but also want it to be always in const bounds.
For any help thanks in advance.

I don’t understand what you are looking to do? What does ‘crop’ mean, if not to change size? What are you wanting to crop?

have you tried applying a transform in your paint to scale up all the painting?

I want to zooming my component in constant size of window. If I zoom in that it is larger than my window is out of window, like that:
32

You see? My window is that square grid. I want to be sure that dashed lines are always inside the grid. But now if I zoom in they go outside line I showed on the screenshot.

No, but I also thought about that. Maybe that’s the solution - I mean AffineTransform