nativescript-community / ui-canvas

Implement Canvas into your NativeScript apps.
https://nativescript-community.github.io/ui-canvas/
Apache License 2.0
31 stars 9 forks source link

Missing support for drawImage with Matrix on iOS #31

Open stemyke opened 3 years ago

stemyke commented 3 years ago

Make sure to check the demo app(s) for sample usage

Checked.

Make sure to check the existing issues in this repository

Checked.

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Is there any code involved?

I think this code snippet or something similar should do the job.

if (args[1] instanceof Matrix) { CGContextConcatCTM(ctx, args[1]._transform); CGContextTranslateCTM(ctx, 0, image.size.height); CGContextScaleCTM(ctx, 1.0, -1.0); CGContextDrawImage(ctx, CGRectMake(0, 0, image.size.width, image.size.height), image.CGImage); return; }

I wanted to create a pull request but I didn't know how to. I just tried to modify the canvas.ios.js code in my project's node_modules folder and it worked. @farfromrefug Can you please check it? It is urgent for my project to finish.

farfromrefug commented 3 years ago

@stemyke should be working in 4.0.46 (in drawBitmap not drawImage !)

stemyke commented 3 years ago

@farfromrefug You are right, I wrote the issue in a hurry, but thanks for quick response :)