nativescript-community / nativescript-community/ui-canvas

Missing support for drawImage with Matrix on iOS

Open
#31 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
38
Forks
9
PR merge metrics
No merged PRs in 30d

Description

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?
  • iOS
  • emulator and device.
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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the drawImage path in canvas.ios.js and compare it with the Matrix snippet in the issue. Test the behavior on both the iOS emulator and device; it is done when drawImage calls using a Matrix render the image with the requested transform.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.