Skip to content

Unecessary dependancy in draw.js + matrix #68

Open
@Incubatio

Description

@Incubatio

The following code in draw.js

// line 653 of gamejs.js
var m = matrix.translate(matrix.identity(), rDest.left, rDest.top);
m = matrix.multiply(m, src._matrix);
this.context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);

add an unecessary dependancy in code, and could be replaced by:

this.context.translate(rDest.left, rDest.top);

Every example seem to still work, but some unit test (not all of them) of rotation and scale seem to break, maybe some refactoring will be needed with transform.js.

Talking about matrix, if such module exists it should not be so coupled to the transformation matrix (add and multiply ,method only work with one dimension matrix with a definite number of arguments which just break reusability of the module), but moved where specific transform are made.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions