bpmn-js/lib/features/auto-resize/BpmnAutoResize.js

38 lines
820 B
JavaScript
Raw Normal View History

import AutoResize from 'diagram-js/lib/features/auto-resize/AutoResize';
import inherits from 'inherits-browser';
import { is } from '../../util/ModelUtil';
/**
* Sub class of the AutoResize module which implements a BPMN
* specific resize function.
*/
export default function BpmnAutoResize(injector) {
injector.invoke(AutoResize, this);
}
BpmnAutoResize.$inject = [
'injector'
];
inherits(BpmnAutoResize, AutoResize);
/**
2019-05-07 11:38:39 +00:00
* Resize shapes and lanes.
*
2019-05-07 11:38:39 +00:00
* @param {djs.model.Shape} target
* @param {Bounds} newBounds
* @param {Object} hints
*/
BpmnAutoResize.prototype.resize = function(target, newBounds, hints) {
if (is(target, 'bpmn:Participant')) {
this._modeling.resizeLane(target, newBounds, null, hints);
} else {
this._modeling.resizeShape(target, newBounds, null, hints);
}
};