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(deps): Revert "chore(deps): bump @antv/matrix-util from 2.0.4 to 3.0.2" #513

Merged
merged 1 commit into from
May 8, 2020
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
2 changes: 1 addition & 1 deletion packages/g-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"dependencies": {
"@antv/event-emitter": "^0.1.1",
"@antv/g-math": "^0.1.3",
"@antv/matrix-util": "^3.0.2",
"@antv/matrix-util": "^2.0.4",
"@antv/path-util": "~2.0.5",
"@antv/util": "~2.0.0",
"@types/d3-timer": "^1.0.9",
Expand Down
12 changes: 6 additions & 6 deletions packages/g-base/src/abstract/element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { each, isEqual, isFunction, isNumber, isObject, isArray, noop, mix, upperFirst, uniqueId } from '@antv/util';
import * as mat3 from '@antv/matrix-util/lib/mat3';
import { transform } from '@antv/matrix-util';
import { IElement, IShape, IGroup, ICanvas, ICtor } from '../interfaces';
import { ClipCfg, ChangeType, OnFrame, ShapeAttrs, AnimateCfg, Animation, BBox, ShapeBase } from '../types';
import { removeFromArray, isParent } from '../util/util';
Expand Down Expand Up @@ -658,7 +658,7 @@ abstract class Element extends Base implements IElement {
*/
translate(translateX: number = 0, translateY: number = 0) {
const matrix = this.getMatrix();
const newMatrix = mat3.transform(matrix, [['t', translateX, translateY]]);
const newMatrix = transform(matrix, [['t', translateX, translateY]]);
this.setMatrix(newMatrix);
return this;
}
Expand Down Expand Up @@ -694,7 +694,7 @@ abstract class Element extends Base implements IElement {
*/
scale(ratioX: number, ratioY?: number) {
const matrix = this.getMatrix();
const newMatrix = mat3.transform(matrix, [['s', ratioX, ratioY || ratioX]]);
const newMatrix = transform(matrix, [['s', ratioX, ratioY || ratioX]]);
this.setMatrix(newMatrix);
return this;
}
Expand All @@ -706,7 +706,7 @@ abstract class Element extends Base implements IElement {
*/
rotate(radian: number) {
const matrix = this.getMatrix();
const newMatrix = mat3.transform(matrix, [['r', radian]]);
const newMatrix = transform(matrix, [['r', radian]]);
this.setMatrix(newMatrix);
return this;
}
Expand All @@ -719,7 +719,7 @@ abstract class Element extends Base implements IElement {
rotateAtStart(rotate: number): IElement {
const { x, y } = this.attr();
const matrix = this.getMatrix();
const newMatrix = mat3.transform(matrix, [
const newMatrix = transform(matrix, [
['t', -x, -y],
['r', rotate],
['t', x, y],
Expand All @@ -735,7 +735,7 @@ abstract class Element extends Base implements IElement {
*/
rotateAtPoint(x: number, y: number, rotate: number): IElement {
const matrix = this.getMatrix();
const newMatrix = mat3.transform(matrix, [
const newMatrix = transform(matrix, [
['t', -x, -y],
['r', rotate],
['t', x, y],
Expand Down
3 changes: 2 additions & 1 deletion packages/g-canvas/tests/bugs/issue-drag-spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const expect = require('chai').expect;
import Canvas from '../../src/canvas';

// import { transform } from '@antv/matrix-util';
// import { getColor } from '../get-color';
function simulateMouseEvent(dom, type, cfg) {
const event = new MouseEvent(type, cfg);
dom.dispatchEvent(event);
Expand Down