From d489c20b842132724faff70b45dc835692b8c385 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 2 Jun 2020 16:22:25 +0200 Subject: [PATCH] io/pointer: update documentation examples Signed-off-by: Elias Naur --- io/pointer/doc.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/io/pointer/doc.go b/io/pointer/doc.go index 6599b979..ed66d9ae 100644 --- a/io/pointer/doc.go +++ b/io/pointer/doc.go @@ -20,7 +20,7 @@ For example, to set up a rectangular hit area: r := image.Rectangle{...} pointer.Rect(r).Add(ops) - pointer.InputOp{Key: h}.Add(ops) + pointer.InputOp{Tag: h}.Add(ops) Note that areas compound: the effective area of multiple area operations is the intersection of the areas. @@ -37,12 +37,12 @@ For example: var stack op.StackOp var h1, h2 *Handler - stack.Push(ops) - pointer.InputOp{Key: h1}.Add(Ops) + stack := op.Push(ops) + pointer.InputOp{Tag: h1}.Add(Ops) stack.Pop() - stack.Push(ops) - pointer.InputOp{Key: h2}.Add(ops) + stack = op.Push(ops) + pointer.InputOp{Tag: h2}.Add(ops) stack.Pop() implies a tree of two inner nodes, each with one pointer handler.