Allow render service to specify handle location

This commit is contained in:
BoykoAlex
2019-11-28 16:19:43 -05:00
parent 5fe0f89494
commit f77e1de15f
2 changed files with 3 additions and 8 deletions

View File

@@ -346,10 +346,6 @@ export class EditorComponent implements OnInit, OnDestroy {
}
createHandle(element: dia.CellView, kind: string, action: () => void, location: dia.Point): dia.Element {
if (!location) {
let bbox: any = (<any>element.model).getBBox();
location = bbox.origin().offset(bbox.width / 2, bbox.height / 2);
}
let handle = Shapes.Factory.createHandle({
renderer: this.renderer,
paper: this.paper,

View File

@@ -687,9 +687,6 @@ export namespace Shapes {
let graph = params.graph || (params.paper ? params.paper.model : undefined);
let handle: dia.Element;
if (!location) {
location = {x: 0, y: 0};
}
if (renderer && _.isFunction(renderer.createHandle)) {
handle = renderer.createHandle(kind, parent);
} else {
@@ -703,7 +700,9 @@ export namespace Shapes {
});
}
handle.set('type', joint.shapes.flo.HANDLE_TYPE);
handle.set('position', location);
if (location) {
handle.set('position', location);
}
if ((isChrome || isFF) && parent && typeof parent.get('z') === 'number') {
handle.set('z', parent.get('z') + 1);
}