Skip to content

Commit

Permalink
Changed setFrame to only check for different size
Browse files Browse the repository at this point in the history
Changing the frame origin should not trigger a re-layout
  • Loading branch information
odrobnik committed Jan 18, 2013
1 parent 17f4f5a commit fcb5165
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions Core/Source/DTAttributedTextContentView.m
Expand Up @@ -581,31 +581,15 @@ - (void)setFrame:(CGRect)frame
return;
}

BOOL frameDidChange = !CGRectEqualToRect(oldFrame, frame);
BOOL frameSizeDidChange = !CGSizeEqualToSize(oldFrame.size, frame.size);

// having a layouter means we are responsible for layouting yourselves
if (frameDidChange)
if (frameSizeDidChange)
{
[self relayoutText];
}
}

//- (void)setFrame:(CGRect)frame
//{
// // sizeToFit also calls this, but we want to be able to avoid relayouting
// [self setFrame:frame relayoutText:_relayoutTextOnFrameChange];
//}

- (void)setDrawDebugFrames:(BOOL)drawDebugFrames
{
if (_drawDebugFrames != drawDebugFrames)
{
_drawDebugFrames = drawDebugFrames;

[self setNeedsDisplay];
}
}

- (void)setShouldDrawImages:(BOOL)shouldDrawImages
{
if (_shouldDrawImages != shouldDrawImages)
Expand Down

0 comments on commit fcb5165

Please sign in to comment.