diff options
| author | Lenni <[email protected]> | 2021-03-06 19:16:45 +0100 |
|---|---|---|
| committer | Lenni <[email protected]> | 2021-03-06 19:16:45 +0100 |
| commit | af19f5db5ee6d5d229c788313c8ffdebc0e25c29 (patch) | |
| tree | 6f4dbfae05c70496a67eb996bd2d65461f7544d1 | |
| parent | dec3b27246bb3a3ac1b6ec401ec9574611dfbae0 (diff) | |
how to fill
| -rw-r--r-- | examples/shapes/main.go | 7 |
1 files changed, 7 insertions, 0 deletions
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 } |
