Skip to content

Commit d41464b

Browse files
authored
fix: incomplete path not included on saving on iOS during (#116)
1 parent e9d87ae commit d41464b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ios/SketchCanvas/RNSketchCanvas.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,11 @@ - (UIImage*)createImageWithTransparentBackground: (BOOL) transparent includeImag
478478
CGContextDrawImage(context, targetRect, _frozenImage);
479479
CGContextDrawImage(context, targetRect, _translucentFrozenImage);
480480

481+
// Include current incomplete path in saved image
482+
if (_currentPath) {
483+
[_currentPath drawInContext:context];
484+
}
485+
481486
if (includeText) {
482487
@autoreleasepool {
483488
for (CanvasText *text in _arrTextOnSketch) {
@@ -514,6 +519,11 @@ - (UIImage*)createImageWithTransparentBackground: (BOOL) transparent includeImag
514519
CGContextDrawImage(context, rect, _frozenImage);
515520
CGContextDrawImage(context, rect, _translucentFrozenImage);
516521

522+
// Include current incomplete path in saved image
523+
if (_currentPath) {
524+
[_currentPath drawInContext:context];
525+
}
526+
517527
if (includeText) {
518528
for (CanvasText *text in _arrTextOnSketch) {
519529
@autoreleasepool {

0 commit comments

Comments
 (0)