mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-28 04:55:12 +00:00
fix #115
This commit is contained in:
@@ -28,9 +28,8 @@
|
||||
|
||||
- (void)renderLayerTo:(CGContextRef)context
|
||||
{
|
||||
if (!self.d) {
|
||||
self.d = [self getPath:context];;
|
||||
}
|
||||
// todo: add detection if path has changed since last update.
|
||||
self.d = [self getPath:context];
|
||||
CGPathRef path = self.d;
|
||||
if ((!self.fill && !self.stroke) || !path) {
|
||||
return;
|
||||
|
||||
@@ -30,13 +30,11 @@ static void RNSVGFreeTextFrame(RNSVGTextFrame frame)
|
||||
_alignment = alignment;
|
||||
}
|
||||
|
||||
- (void)setTextFrame:(RNSVGTextFrame)frame
|
||||
- (void)setTextFrame:(RNSVGTextFrame)textFrame
|
||||
{
|
||||
if (frame.lines == _textFrame.lines) {
|
||||
RNSVGFreeTextFrame(_textFrame);
|
||||
}
|
||||
RNSVGFreeTextFrame(_textFrame);
|
||||
[self invalidate];
|
||||
_textFrame = frame;
|
||||
_textFrame = textFrame;
|
||||
}
|
||||
|
||||
- (void)setPath:(NSArray *)path
|
||||
@@ -99,6 +97,7 @@ static void RNSVGFreeTextFrame(RNSVGTextFrame frame)
|
||||
CTRunGetPositions(run, CFRangeMake(0, 0), positions);
|
||||
CTRunGetGlyphs(run, CFRangeMake(0, 0), glyphs);
|
||||
CFDictionaryRef attributes = CTRunGetAttributes(run);
|
||||
|
||||
CTFontRef runFont = CFDictionaryGetValue(attributes, kCTFontAttributeName);
|
||||
|
||||
RNSVGBezierPath *bezierPath = [[RNSVGBezierPath alloc] initWithBezierCurves:self.path];
|
||||
|
||||
Reference in New Issue
Block a user