From 0dc0d72e6811d3f25b5fd02f51adbd96666244a9 Mon Sep 17 00:00:00 2001 From: natmark Date: Thu, 31 Jan 2019 22:21:32 +0900 Subject: [PATCH] Fix textAlign(.right) --- ProcessingKit/Core/Typography/Text.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ProcessingKit/Core/Typography/Text.swift b/ProcessingKit/Core/Typography/Text.swift index 05e9c21..665742f 100644 --- a/ProcessingKit/Core/Typography/Text.swift +++ b/ProcessingKit/Core/Typography/Text.swift @@ -56,7 +56,11 @@ public struct TextModel: TextModelContract { if self.textComponents.textAlignX == .center { self.text(str, x - width / 2, y, width, height) return + } else if self.textComponents.textAlignX == .right { + self.text(str, x - width, y, width, height) + return } + self.text(str, x, y, width, height) }