From 37b143d5fa3d5a46dfbc0bab53a14eb6324aa096 Mon Sep 17 00:00:00 2001 From: Ben LeFevre Date: Tue, 21 Jan 2020 13:13:47 -0500 Subject: [PATCH 1/2] Add Flex.Clear() method to remove all items --- flex.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flex.go b/flex.go index 56cbc75..24981c1 100644 --- a/flex.go +++ b/flex.go @@ -101,6 +101,12 @@ func (f *Flex) RemoveItem(p Primitive) *Flex { return f } +// Clear removes all items from the flexbox +func (f *Flex) Clear() *Flex { + f.items = nil + return f +} + // ResizeItem sets a new size for the item(s) with the given primitive. If there // are multiple Flex items with the same primitive, they will all receive the // same size. For details regarding the size parameters, see AddItem(). From 016b6bd9e3f85dfd3d3ebdb6a4635e0917cfb2b1 Mon Sep 17 00:00:00 2001 From: Ben LeFevre Date: Mon, 27 Jan 2020 14:37:07 +0000 Subject: [PATCH 2/2] Update Flex.Clear() documentation --- flex.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flex.go b/flex.go index 24981c1..d012392 100644 --- a/flex.go +++ b/flex.go @@ -101,7 +101,7 @@ func (f *Flex) RemoveItem(p Primitive) *Flex { return f } -// Clear removes all items from the flexbox +// Clear removes all items from the container. func (f *Flex) Clear() *Flex { f.items = nil return f