Parcourir la source

bugfix for YYLabel when display text in vertical form

ibireme il y a 9 ans
Parent
commit
31aca71e58
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      YYText/YYLabel.m

+ 2 - 2
YYText/YYLabel.m

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