mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-26 16:35:52 +00:00
Compensate box frame in nib2cib
This commit is contained in:
1 parent
b23cadea59
commit
cc45fb58a8
1 file changed
+14
-1
+14
-1
@@ -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];
|
||||
|
||||
|
||||
Reference in new issue
Block a user