mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
op/clip: add UniformRRect to create rects with uniform corner radii
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -7,6 +7,18 @@ import (
|
|||||||
"gioui.org/op"
|
"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
|
// RRect represents the clip area of a rectangle with rounded
|
||||||
// corners.
|
// corners.
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user