Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid numeric value (NaN, or not-a-number) to CoreGraphics API #268

Open
DerJojo11 opened this issue Feb 14, 2024 · 1 comment
Open

Invalid numeric value (NaN, or not-a-number) to CoreGraphics API #268

DerJojo11 opened this issue Feb 14, 2024 · 1 comment

Comments

@DerJojo11
Copy link

When I open a PDF in iOS, my Debug Console get a lot of Errors.

It is always the same Error:

CGContextAddLineToPoint: no current point.
CGContextClosePath: no current point.
Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem._
If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable.

I start looking for the error and find something from StackOverflow. I tried it out and this fix it.

- (instancetype)initWithFrame:(CGRect)frame
                    arguments:(id _Nullable)args
                    controler:(nonnull FLTPDFViewController *)controler {
    if ([super init]) {
        _controler = controler;
        
        // Adding this CGRect instead of frame solved the problem
        CGRect rect = CGRectMake(0, 0, 100, 100);
        _pdfView = [[PDFView alloc] initWithFrame: rect];
        _pdfView.delegate = self;
@Reyrey14-1
Copy link

thanks for letting me know! it was so ugly while debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants