I don't think the problem was with Raphael 2.1 per say
I used dev-tools inspector to see the actual outputted html
Upon further inspection your svg seems to be in one place and your <div id="my-canvas"><div>
was empty
I fixed it by using the paper object to reference the canvas instead of reselecting using jQuery, which selected the still empty div tag.
var paper = Raphael("my-canvas",0, 0, 300, 400);
var origin = paper.rect(10, 10, 10, 10).attr({fill: "white"});
origin.mousedown(function(e) {
line = Line(e.offsetX, e.offsetY, paper);
$(paper.canvas).mousemove( function(e) {line.updateEnd(e.offsetX, e.offsetY);});
});
$(paper.canvas).mouseup(function(e) {$(paper.canvas).unbind('mousemove'); });
see JSFiddle
Now my fix aside this is somewhat weird behavior you would expect the canvas to be inside the div tag.
The behavior itself is similar to another Raphael behavior, which is what happens when you create the paper object without a div like so (see JSFiddle).
var paper = Raphael(0, 0, 300, 400);
I also noticed one more thing and that now the height is properly drawn at 400px
vs. before when it was the opposite. 400 width 300 height
So maybe in Rapahel 2.1 they changed the constructor.
I go visit the documentation and sure enough
This is how you they initialize the paper with a div now
// Each of the following examples create a canvas
// that is 320px wide by 200px high.
// Canvas is created at the viewport’s 10,50 coordinate.
var paper = Raphael(10, 50, 320, 200);
// Canvas is created at the top left corner of the #notepad element
// (or its top right corner in dir="rtl" elements)
var paper = Raphael(document.getElementById("notepad"), 320, 200);
// Same as above
var paper = Raphael("notepad", 320, 200);
So if you wanna create a canvas on a div you need to only include the width and height now (see fiddle).
I kept my reference of paper.canvas instead of reselecting the div just because it's more efficient and is sure to work either way.
I hope this fully answers your question have a sunny day.