mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-06 08:22:23 +00:00
Fix TextPath bug when using lines
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
[self setupGlyphContext:context];
|
||||
|
||||
CGPathRef path = [self getGroupPath:context];
|
||||
CGAffineTransform transform = [self getAlignTransform:context path:path];
|
||||
CGAffineTransform transform = [self getAlignTransform:path];
|
||||
CGContextConcatCTM(context, transform);
|
||||
[self renderGroupTo:context];
|
||||
[self releaseCachedPath];
|
||||
@@ -73,7 +73,7 @@
|
||||
{
|
||||
[self setupGlyphContext:context];
|
||||
CGPathRef groupPath = [self getGroupPath:context];
|
||||
CGAffineTransform transform = [self getAlignTransform:context path:groupPath];
|
||||
CGAffineTransform transform = [self getAlignTransform:groupPath];
|
||||
[self releaseCachedPath];
|
||||
|
||||
return (CGPathRef)CFAutorelease(CGPathCreateCopyByTransformingPath(groupPath, &transform));
|
||||
@@ -86,7 +86,7 @@
|
||||
[self popGlyphContext];
|
||||
}
|
||||
|
||||
- (CGAffineTransform)getAlignTransform:(CGContextRef)context path:(CGPathRef)path
|
||||
- (CGAffineTransform)getAlignTransform:(CGPathRef)path
|
||||
{
|
||||
CGFloat width = CGRectGetWidth(CGPathGetBoundingBox(path));
|
||||
CGFloat x = 0;
|
||||
@@ -152,12 +152,6 @@
|
||||
[[[self getTextRoot] getGlyphContext] popContext];
|
||||
}
|
||||
|
||||
- (CGPoint)getGlyphLineOffset
|
||||
{
|
||||
RNSVGText *text = [self getTextRoot];
|
||||
return CGPointMake(text.lastX, text.lastY);
|
||||
}
|
||||
|
||||
- (CTFontRef)getFontFromContext
|
||||
{
|
||||
return [[[self getTextRoot] getGlyphContext] getGlyphFont];
|
||||
|
||||
Reference in New Issue
Block a user