You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2017/04/13 11:20:55 UTC
[05/23] incubator-weex git commit: * [ios] remove unused code
* [ios] remove unused code
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ae6edeeb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ae6edeeb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ae6edeeb
Branch: refs/heads/0.12-dev
Commit: ae6edeebcd9fa549f599b840e9cfc88f52aa64dc
Parents: 1e34a1f
Author: acton393 <zh...@gmail.com>
Authored: Tue Apr 11 11:37:15 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Apr 11 11:37:15 2017 +0800
----------------------------------------------------------------------
.../WeexSDK/Sources/Component/WXTextComponent.m | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ae6edeeb/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
index 5c501a9..eb6eb82 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
@@ -140,8 +140,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
-
-
#define WX_STYLE_FILL_TEXT(key, prop, type, needLayout)\
do {\
id value = styles[@#key];\
@@ -545,7 +543,6 @@ do {\
textFrame.size.height = bounds.size.height*2;
//flip the coordinate system
- CGContextRetain(context);
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
CGContextTranslateCTM(context, 0, textFrame.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
@@ -554,6 +551,7 @@ do {\
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddRect(path, NULL, textFrame);
NSMutableAttributedString * attributedStringCopy = [self buildCTAttributeString];
+
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((__bridge CFAttributedStringRef)attributedStringCopy);
CTFrameRef frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, NULL);
@@ -562,7 +560,6 @@ do {\
CGPoint lineOrigins[lineCount];
CTFrameGetLineOrigins(frame, CFRangeMake(0, 0), lineOrigins);
- CGFloat frameY = 0;
for (CFIndex index = 0; index < lineCount; index ++) {
CTLineRef lineRef = CFArrayGetValueAtIndex(lines, index);
CGFloat lineAscent;
@@ -571,19 +568,8 @@ do {\
CTLineGetTypographicBounds(lineRef, &lineAscent, &lineDescent, &lineLeading);
CGPoint lineOrigin = lineOrigins[index];
-
- NSLog(@"lineAscent = %f",lineAscent);
- NSLog(@"lineDescent = %f",lineDescent);
- NSLog(@"lineLeading = %f",lineLeading);
-
- if (index > 0) {
- frameY = frameY - lineAscent;
- }else {
- frameY = lineOrigin.y;
- }
lineOrigin.x += padding.left;
lineOrigin.y -= padding.top;
- NSLog(@"lines: %ld origin: %@",index, NSStringFromCGPoint(lineOrigin));
CGContextSetTextPosition(context, lineOrigin.x, lineOrigin.y);
// CTLineDraw(lineRef, context);
CFArrayRef runs = CTLineGetGlyphRuns(lineRef);
@@ -591,7 +577,6 @@ do {\
CTRunRef run = CFArrayGetValueAtIndex(runs, runIndex);
CTRunDraw(run, context, CFRangeMake(0, 0));
}
- frameY = frameY - lineDescent;
}
CFRelease(frame);