Compensate box frame in nib2cib

This commit is contained in:
Antoine Mercadal committed 2013-01-24 19:46:08 -08:00
1 parent b23cadea59
commit cc45fb58a8
1 file changed
+14 -1
+14 -1
View File
@@ -22,7 +22,7 @@
@import <AppKit/CPBox.j>
@implementation CPBox (CPCoding)
@implementation CPBox (NSCoding)
- (id)NS_initWithCoder:(CPCoder)aCoder
{
@@ -39,6 +39,19 @@
borderWidth = [aCoder decodeFloatForKey:@"NSBorderWidth2"],
contentMargin = [aCoder decodeSizeForKey:@"NSOffsets"];
// small hack to position the box pixel perfect
var frame = [self frame];
if (_boxType !== CPBoxSeparator)
{
frame.origin.y += 4;
frame.origin.x += 4;
frame.size.width -= 8;
frame.size.height -= 6;
}
[self setFrame:frame];
if (borderColor)
[self setBorderColor:borderColor];