diff --git a/op/clip/shapes.go b/op/clip/shapes.go index 52091290..5a136619 100644 --- a/op/clip/shapes.go +++ b/op/clip/shapes.go @@ -7,6 +7,18 @@ import ( "gioui.org/op" ) +// UniformRRect returns an RRect with all corner radii set to the +// provided radius. +func UniformRRect(rect f32.Rectangle, radius float32) RRect { + return RRect{ + Rect: rect, + SE: radius, + SW: radius, + NE: radius, + NW: radius, + } +} + // RRect represents the clip area of a rectangle with rounded // corners. //