From af19f5db5ee6d5d229c788313c8ffdebc0e25c29 Mon Sep 17 00:00:00 2001 From: Lenni Date: Sat, 6 Mar 2021 19:16:45 +0100 Subject: how to fill --- examples/shapes/main.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'examples/shapes') diff --git a/examples/shapes/main.go b/examples/shapes/main.go index 0746e2e..0816e61 100644 --- a/examples/shapes/main.go +++ b/examples/shapes/main.go @@ -121,6 +121,10 @@ func main() { {X: 80, Y: 50, Width: 10, Height: 40}, } + // This rectangle we will use to demonstrate filling a shape. + rectangles2 := []xproto.Rectangle{ + {X: 150, Y: 50, Width: 20, Height: 60}, + } // Arcs are defined by a top left position (notice where the third line goes to) // their width and height, a starting and end angle. @@ -163,6 +167,9 @@ func main() { // Draw the circular arcs in blue. xproto.PolyArc(X, draw, blue, arcs) + // There's also a fill variant for all drawing commands: + xproto.PolyFillRectangle(X, draw, red, rectangles2) + case xproto.DestroyNotifyEvent: return } -- cgit v1.2.3