Franklinjagan / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Crash on vertical straight connectors. #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I seem to be having a problem printing labels on STRAIGHT plumb connectors 
that point perfectly down:

Error: uncaught exception: [Exception... "An invalid or illegal string was 
specified"  code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)"  
location: "http://tar.neothinktank.net/scripts/jquery.jsPlumb-1.2.5-all.js
Line: 2922"]

This is because in the case of perfectly vertical straight lines, ctx.y will 
be positive or negative INFINITY. Some check for this case should be made to 
prevent crashes in this case.

What steps will reproduce the problem?
1. Create any STRAIGHT connector that points perfectly down.
2. Make sure that connector has a label.
3. Boom

What version of the product are you using? On what browser and OS?
jsplumb 1.2.5 on Linux Firefox 3.5.16.

Please provide any additional information below.

Original issue reported on code.google.com by mmxb...@gmail.com on 13 Feb 2011 at 5:57

GoogleCodeExporter commented 9 years ago
hello, I have the same problem.
I solve it by add after line @2358 : if (_m == Infinity) _m=0;
I attach file with patch.

Original comment by piotrbrzuska on 19 Mar 2011 at 6:59

Attachments:

GoogleCodeExporter commented 9 years ago
thankyou for that.  attached is the latest build of 1.2.6-RC1 with your fix 
applied; could you verify that it works for you?

Original comment by simon.po...@gmail.com on 19 Mar 2011 at 11:25

Attachments:

GoogleCodeExporter commented 9 years ago
turns out that setting the gradient to zero if it was infinity caused other 
bugs.  i've fixed this for real now. it will be in 1.2.6.

Original comment by simon.po...@gmail.com on 7 May 2011 at 2:48

GoogleCodeExporter commented 9 years ago

Original comment by simon.po...@gmail.com on 2 Jun 2011 at 4:24