sproutcore/sproutcore — pull request #958 by dcporter (2013-03-13 16:10:07+00:00)
Title: Fix for centerFoo + border layout issue.

CenterX and centerY layout properties translate into the standard abspo css centering:

```css
top/left: 50%;
margin-top/margin-left: -half height/width;
```

Border layout properties, meanwhile, shrink the size of the element so that the border fits inside your specified length and width, rather than outside of it as is standard with HTML layout. (HTML's box model doesn't fit well with the absolutely positioned nature of apps.)

When a view is centered and has a border, the layout engine is calculating the margin-top/margin-left based on the view's shrunk inner size rather than its actual size, border and all. For example, an object with ```layout: { height: 10, width: 10, centerX: 0, centerY: 0, border: 2 }``` will end up with ```style="height: 6px; width: 6px; top: 50%; left: 50%; margin-top: -3px; margin-bottom: -3px"```. The margins won't be sufficient to center the bordered element, and it'll appear too far down and too far to the right.

The unit tests helpfully tested & passed this behavior; I've modified them to test & pass the new behavior.