From 85bc397af2828380b5de77a57a44a141af6fe376 Mon Sep 17 00:00:00 2001 From: Andreas Bieber Date: Wed, 16 Sep 2020 13:26:56 +0200 Subject: [PATCH] feat(flex): Add `GetDirection` --- flex.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flex.go b/flex.go index 106a498..0fe223b 100644 --- a/flex.go +++ b/flex.go @@ -58,6 +58,14 @@ func NewFlex() *Flex { return f } +// GetDirection returns the direction in which the contained primitives are +// distributed. This can be either FlexColumn (default) or FlexRow. +func (f *Flex) GetDirection() int { + f.l.RLock() + defer f.l.RUnlock() + return f.direction +} + // SetDirection sets the direction in which the contained primitives are // distributed. This can be either FlexColumn (default) or FlexRow. func (f *Flex) SetDirection(direction int) *Flex {