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

fix(context): ⚓ Removes argument to getters #47

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const path = new Path2D();
path.arc(100, 101, 10, 0, Math.PI * 2);

afterEach(() => {
const drawCalls = ctx.__getDrawCalls(ctx);
const drawCalls = ctx.__getDrawCalls();
expect(drawCalls).toMatchSnapshot();
});

Expand Down
2 changes: 1 addition & 1 deletion __tests__/classes/CanvasRenderingContext2D.__getEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path.arc(100, 101, 10, 0, Math.PI * 2);
const imgData = new ImageData(100, 100);

afterEach(() => {
const drawCalls = ctx.__getEvents(ctx);
const drawCalls = ctx.__getEvents();
expect(drawCalls).toMatchSnapshot();
});

Expand Down
2 changes: 1 addition & 1 deletion __tests__/classes/CanvasRenderingContext2D.__getPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const path = new Path2D();
path.arc(100, 101, 10, 0, Math.PI * 2);

afterEach(() => {
const drawCalls = ctx.__getPath(ctx);
const drawCalls = ctx.__getPath();
expect(drawCalls).toMatchSnapshot();
});

Expand Down
6 changes: 3 additions & 3 deletions src/classes/CanvasRenderingContext2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class CanvasRenderingContext2D {
* an event is added to this array. This goes for every property set, and draw call.
*/
_events = [];
__getEvents(ctx) {
__getEvents() {
return this._events.slice();
}

Expand All @@ -56,8 +56,8 @@ export default class CanvasRenderingContext2D {
* path.
*/
_path = [createCanvasEvent('beginPath', [1, 0, 0, 1, 0, 0], {})];
__getPath(ctx) {
return ctx._path.slice();
__getPath() {
return this._path.slice();
}

_directionStack = ['inherit'];
Expand Down