Skip to content

Rounded rectangle clipping does not support non-rectangular inner shapes (ripple effect leaks outside corners) #371

@meluner1

Description

@meluner1
Image

Hi,
I’ve run into a clipping issue when drawing inside a rounded rectangle view.

Image

I have a button (or view) with rounded corners, and inside it I draw another shape — for example, a circular ripple effect. The problem is that the clipping applied by VSTGUI seems to be strictly rectangular, so the inner shape is clipped only as a rectangle, not as a rounded rectangle. Because of that, the circle exceeds the rounded corners and becomes visible outside the view’s curved edges.

My expectation is that the drawing inside a rounded-rectangle view should be clipped using a rounded clip path. Something like setClipPath() or a path-based clipping mechanism would solve this, but VSTGUI currently doesn’t provide such API. Only rectangular clipping is available, so any non-rectangular shape inside a rounded view can leak through the corners.

This makes implementing ripple effects or similar animations inside round-rect views difficult.

Steps to reproduce:

Create a custom view with rounded corners (using CDrawContext::drawRect or path).

Draw a circular expanding ripple inside the view.

Notice that the circle is clipped by a rectangle, not the rounded rect.

Expected behavior:

Inner drawing should be clipped to the rounded rectangle shape.

Actual behavior:

Only rectangular clipping is applied → elements exceed rounded corners.

Request:

Would it be possible to add support for:

path-based clipping (e.g., setClipPath)
or

automatic shape-based clipping for views with rounded corners?

This feature would fix visual artifacts for ripple effects and other non-rectangular internal drawings.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions