kangax/fabric.js — pull request #1103 by maciej-filip-sz (2014-01-16 23:34:38+00:00)
Title: Line object coordinates are correct

Patch for issue #1018.

fabric.Line._setWidthHeight was assigning left and top as if both
origins were 'center'.

It now uses private helper methods to calculate the distances from
left and top edges of canvas to the line origins.

The data for existing Line.toObject test is updated with origin-relative
coordinates.

I might have gone a bit overboard with the test cases.

Fixing the coordinates caused a path-group rendering bug I couldn't understand:
http://jsfiddle.net/YtCC2/56/

After some experimentation I came up with a solution that works, but I don't know why it works:
http://jsfiddle.net/YtCC2/57/

I didn't know how to test rendering, and didn't find any existing `_render` tests.