Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

When animating set document frame temporarily to entire view.

Without that the bottom element flickers when enlarging a section above it
  • Loading branch information...
commit 31fc897cd6deebe72fa10e9b38b6ddc4cfe94621 1 parent fa42eef
@Cocoanetics authored
Showing with 14 additions and 3 deletions.
  1. +14 −3 DMInspectorPalette/DMPaletteContainer.m
View
17 DMInspectorPalette/DMPaletteContainer.m
@@ -137,15 +137,21 @@ - (void)layoutSubviewsAnimated:(BOOL)animated
{
if (animated)
{
+ // temporarily set the document view frame to the entire contianer, to avoid flicker at bottom section
+ [[self documentView] setFrame:self.bounds];
+
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:kDMPaletteContainerAnimationDuration];
+ [[NSAnimationContext currentContext] setCompletionHandler:^{
+ NSRect contentRect = [self boundsForContent];
+ [[self documentView] setFrame:contentRect];
+ }];
}
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"index" ascending:YES];
contentSectionViews = [contentSectionViews sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
- NSRect contentRect = [self boundsForContent];
- [[self documentView] setFrame:contentRect];
-
+
+
[contentSectionViews enumerateObjectsUsingBlock:^(DMPaletteSectionView* paletteSection, NSUInteger idx, BOOL *stop) {
if (animated)
{
@@ -161,6 +167,11 @@ - (void)layoutSubviewsAnimated:(BOOL)animated
{
[NSAnimationContext endGrouping];
}
+ else
+ {
+ NSRect contentRect = [self boundsForContent];
+ [[self documentView] setFrame:contentRect];
+ }
}
#pragma mark - Manage sections
Please sign in to comment.
Something went wrong with that request. Please try again.