Closed rohitj closed 10 years ago
Make a pull request dude
Sorry! I am glad I started making a pull request. Because then I had to be extra careful, and I realized that I was wrong. minX is computed for objects inside the container. So, -minX (and -minX + paddingX when there is padding) is infact distance of the left most point from the center. Sorry for wasting time.
Line 164 and 165 that calculates cx and cy for container after fit() seems to be wrong. Instead of computing the distance between the left most point and the center, it seems to be calculating something completely different.
this.p.cx = -minX + paddingX; this.p.cy = -minY + paddingY;
These should be:
this.p.cx = (maxX - minX) / 2 + paddingX; this.p.cy = (maxY - minY) / 2 + paddingY;