kangax/fabric.js — pull request #1691 by vamo89 (2014-09-22 14:36:30+00:00)
Title: Fix setCoords for negative width and/or height

Hi,

I'm using fabric to let the user draw some Rect on screen with the mouse.
The Rect has perPixelTargetFind enabled and no fill.

Everything is ok when he draws from top-left to bottom-right.

Although, when he draws from bottom-right to top-left, the selection area is drawed inside his borders, and this make selection very hard, since there's only a pixel (sometimes none) on each side that is inside selection area and is not transparent, making it selectable because of perPixelTargetFind.

I found that in setCoords, strokeWidth is checked for positive numbers only, and added to width and height, but if I have a negative width or height there, the selection area will decrease in abs.

This problem is related to https://github.com/kangax/fabric.js/issues/142