bpmn-io / bpmn-js-nyan

bpmn-js, nyan cat style :rainbow: :cat:
MIT License
91 stars 27 forks source link

resizeAllModule bug #5

Closed ShadowSpeedy closed 4 years ago

ShadowSpeedy commented 4 years ago

when i use resizeAllModule in additionalModules then if i click the SequenceFlow
error occured in console

image

EventBus.js?8845:377 TypeError: Failed to execute 'setTranslate' on 'SVGTransform': The provided float value is non-finite.
    at transform (SvgTransformUtil.js?9069:16)
    at ResizeHandles._createResizer (ResizeHandles.js?8dec:126)
    at ResizeHandles.createResizer (ResizeHandles.js?8dec:137)
    at ResizeHandles.addResizer (ResizeHandles.js?8dec:163)
    at forEach (index.esm.js?3736:166)
    at eval (ResizeHandles.js?8dec:60)
    at invokeFunction (EventBus.js?8845:509)
    at EventBus._invokeListener (EventBus.js?8845:362)
    at EventBus._invokeListeners (EventBus.js?8845:348)
    at EventBus.fire (EventBus.js?8845:310)
nikku commented 4 years ago

Please provide a test case that allows us to reproduce this issue. Or, file a PR that fixes it.

philippfromme commented 4 years ago

Closing this. Feel free to re-open if you can provide a test or a fix.

ShadowSpeedy commented 4 years ago

sorry to reply so late in diagram-js\lib\features\resize\ResizeHandles.js line 91 _createResizer = function(element, x, y, rotation, direction) when i click SequenceFlow the parm x, y would be NaN then the error occured in function "transform" in (diagram-js\lib\util\SvgTransformUtil.js )

image image

So I added this Line to prevent this if (x != undefined && y!=undefined && !window.isNaN(x) && !window.isNaN(y))

crmarin commented 3 years ago

In file ResizeAllRules.js ResizeAllRules.prototype.init = function () { this.addRule('shape.resize', 1500, function (data) { if (data.shape.type === 'bpmn:MyType' || data.shape.type === 'bpmn:Other' || data.shape.type === 'bpmn:TaskX' ) { return true; } }); };