From b1942f64b0cbdb0f6f30d318795151e3d04279f4 Mon Sep 17 00:00:00 2001 From: Chris Waldon Date: Mon, 24 Oct 2022 10:51:56 -0400 Subject: [PATCH] io/system: implement Stringer on TextDirection Signed-off-by: Chris Waldon --- io/system/locale.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/io/system/locale.go b/io/system/locale.go index 7bc75817..388d2e5b 100644 --- a/io/system/locale.go +++ b/io/system/locale.go @@ -34,6 +34,15 @@ func (d TextDirection) Progression() TextProgression { return TextProgression((d & (1 << progressionShift)) >> progressionShift) } +func (d TextDirection) String() string { + switch d { + case RTL: + return "RTL" + default: + return "LTR" + } +} + // TextAxis defines the layout axis of text. type TextAxis byte