nativescript-community / nativescript-community/ui-canvas

Missing Matrix.mapPoints one parameter version iOS

Open
#32 1 comment 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

@farfromrefug Can you please modify the function this way in canvas.ios.ts?

public mapPoints(...args) {
        let src: number[];
        let dstIndex: number = 0,
            srcIndex: number = 0,
            pointCount: number;
        const pts: number[] = args[0];
        if (args.length <= 2) {
            src = args[args.length-1];
        } else {
            dstIndex = args[1] || 0;
            srcIndex = args[3] || 0;
            pointCount = args[4];
            src = args[2];
        }
        src = src || pts;
        pointCount = Math.floor(pointCount || src.length);
        for (let index = 0; index < pointCount; index += 2) {
            const cgPoint = CGPointApplyAffineTransform(CGPointMake(src[index + srcIndex], src[index + srcIndex + 1]), this._transform);
            pts[index + dstIndex] = cgPoint.x;
            pts[index + dstIndex + 1] = cgPoint.y;
        }
    }

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 in canvas.ios.ts at Matrix.mapPoints and compare its current argument handling with the one-parameter behavior requested in the issue. Verify that the iOS implementation accepts the single points-array form and maps the points correctly; done means that form works without breaking the other documented argument forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
computer-graphics, mobile-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.