fix: bug修复

This commit is contained in:
黎智洲
2021-12-03 16:16:34 +08:00
parent 34679ff328
commit aa9381c9c2
8 changed files with 26 additions and 33 deletions
+5 -5
View File
@@ -1,10 +1,10 @@
import { Util } from '@antv/g6';
import { Util, Item } from '@antv/g6';
export type animationConfig = {
duration: number;
timingFunction: string;
callback?: Function;
callback?: () => void;
[key: string]: any;
}
@@ -19,7 +19,7 @@ export const Animations = {
* @param G6Item
* @param animationConfig
*/
APPEND(G6Item: any, animationConfig: animationConfig) {
APPEND(G6Item: Item, animationConfig: animationConfig) {
const type = G6Item.getType(),
group = G6Item.getContainer(),
Mat3 = Util.mat3,
@@ -54,7 +54,7 @@ export const Animations = {
* @param G6Item
* @param animationConfig
*/
REMOVE(G6Item: any, animationConfig: animationConfig) {
REMOVE(G6Item: Item, animationConfig: animationConfig) {
const type = G6Item.getType(),
group = G6Item.getContainer(),
Mat3 = Util.mat3,
@@ -84,7 +84,7 @@ export const Animations = {
* @param G6Item
* @param animationConfig
*/
FADE_IN(G6Item: any, animationConfig: animationConfig) {
FADE_IN(G6Item: Item, animationConfig: animationConfig) {
const group = G6Item.getContainer(),
animateCfg = {
duration: animationConfig.duration,
+3 -3
View File
@@ -186,8 +186,8 @@ export class LayoutProvider {
// 左往右布局
for (let i = 0; i < modelGroupList.length; i++) {
group = modelGroupList[i],
bound = group.getPaddingBound(this.viewOptions.groupPadding);
group = modelGroupList[i];
bound = group.getPaddingBound(this.viewOptions.groupPadding);
if (prevBound) {
dx = prevBound.x + prevBound.width - bound.x;
@@ -231,7 +231,7 @@ export class LayoutProvider {
height = this.viewContainer.getG6Instance().getHeight(),
leakAreaHeightRatio = this.engine.viewOptions.leakAreaHeight;
if(this.viewContainer.hasLeak) {
if (this.viewContainer.hasLeak) {
height = height * (1 - leakAreaHeightRatio);
}
+5 -1
View File
@@ -6,7 +6,7 @@ import { SVModel } from "../Model/SVModel";
import { Renderer } from "./renderer";
import { Reconcile } from "./reconcile";
import { FixNodeMarkerDrag } from "../BehaviorHelper/fixNodeMarkerDrag";
import { InitDragCanvasWithLeak } from "../BehaviorHelper/dragCanavsWithLeak";
import { InitDragCanvasWithLeak } from "../BehaviorHelper/dragCanvasWithLeak";
import { EventBus } from "../Common/eventBus";
import { Group } from "../Common/group";
@@ -144,6 +144,10 @@ export class ViewContainer {
this.prevLayoutGroupTable = layoutGroupTable;
this.prevModelList = modelList;
// modelList.forEach(item => {
// console.log(item.getModelType(), item.getBound());
// });
}
/**