浏览代码

bugfix for YYLabel when display text in vertical form

ibireme 9 年之前
父节点
当前提交
31aca71e58
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      YYText/YYLabel.m

+ 2 - 2
YYText/YYLabel.m

@@ -914,13 +914,13 @@ static dispatch_queue_t YYLabelGetReleaseQueue() {
         CGPoint point = CGPointZero;
         if (verticalAlignment == YYTextVerticalAlignmentCenter) {
             if (layout.container.isVerticalForm) {
-                point.x = (size.width - boundingSize.width) * 0.5;
+                point.x = -(size.width - boundingSize.width) * 0.5;
             } else {
                 point.y = (size.height - boundingSize.height) * 0.5;
             }
         } else if (verticalAlignment == YYTextVerticalAlignmentBottom) {
             if (layout.container.isVerticalForm) {
-                point.x = (size.width - boundingSize.width);
+                point.x = -(size.width - boundingSize.width);
             } else {
                 point.y = (size.height - boundingSize.height);
             }