Skip to content

Commit

Permalink
Merge pull request #693 from sptramer/1_8_X
Browse files Browse the repository at this point in the history
[TIMOB-6147][1_8_X] Merge pull request #692 from sptramer/submit-hotfix
  • Loading branch information
rseagraves committed Nov 14, 2011
2 parents 188b5bb + ba737a8 commit 1012866
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions iphone/Classes/TiAnimation.m
Expand Up @@ -463,16 +463,16 @@ -(void)animate:(id)args
if ([view_ isKindOfClass:[TiUIView class]])
{ //TODO: Shouldn't we be updating the proxy's properties to reflect this?
TiUIView *uiview = (TiUIView*)view_;
LayoutConstraint *layout = [(TiViewProxy *)[uiview proxy] layoutProperties];
LayoutConstraint *layoutProperties = [(TiViewProxy *)[uiview proxy] layoutProperties];


BOOL doReposition = NO;

#define CHECK_LAYOUT_CHANGE(a) \
if (a!=nil && layout!=NULL) \
if (a!=nil && layoutProperties!=NULL) \
{\
autoreverseLayout.a = layout->a; \
layout->a = TiDimensionFromObject(a); \
autoreverseLayout.a = layoutProperties->a; \
layoutProperties->a = TiDimensionFromObject(a); \
doReposition = YES;\
}\
else \
Expand All @@ -485,12 +485,12 @@ -(void)animate:(id)args
CHECK_LAYOUT_CHANGE(height);
CHECK_LAYOUT_CHANGE(top);
CHECK_LAYOUT_CHANGE(bottom);
if (center!=nil && layout != NULL)
if (center!=nil && layoutProperties != NULL)
{
autoreverseLayout.centerX = layout->centerX;
autoreverseLayout.centerY = layout->centerY;
layout->centerX = [center xDimension];
layout->centerY = [center yDimension];
autoreverseLayout.centerX = layoutProperties->centerX;
autoreverseLayout.centerY = layoutProperties->centerY;
layoutProperties->centerX = [center xDimension];
layoutProperties->centerY = [center yDimension];
doReposition = YES;
}
else
Expand Down
14 changes: 7 additions & 7 deletions iphone/Classes/TiUIButton.m
Expand Up @@ -185,19 +185,19 @@ -(void)setImage_:(id)value
// if the layout is undefined or auto, we need to take the size of the image
//TODO: Refactor. This will cause problems if there's multiple setImages called,
//Since we change the values of the proxy.
LayoutConstraint *layout = [(TiViewProxy *)[self proxy] layoutProperties];
LayoutConstraint *layoutProperties = [(TiViewProxy *)[self proxy] layoutProperties];
BOOL reposition = NO;

if (TiDimensionIsUndefined(layout->width) || TiDimensionIsAuto(layout->width))
if (TiDimensionIsUndefined(layoutProperties->width) || TiDimensionIsAuto(layoutProperties->width))
{
layout->width.value = image.size.width;
layout->width.type = TiDimensionTypePixels;
layoutProperties->width.value = image.size.width;
layoutProperties->width.type = TiDimensionTypePixels;
reposition = YES;
}
if (TiDimensionIsUndefined(layout->height) || TiDimensionIsAuto(layout->height))
if (TiDimensionIsUndefined(layoutProperties->height) || TiDimensionIsAuto(layoutProperties->height))
{
layout->height.value = image.size.height;
layout->height.type = TiDimensionTypePixels;
layoutProperties->height.value = image.size.height;
layoutProperties->height.type = TiDimensionTypePixels;
}
if (reposition)
{
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiViewProxy.m
Expand Up @@ -175,7 +175,7 @@ -(void)remove:(id)arg
[childView performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:NO];
if (layoutNeedsRearranging)
{
[self performSelectorOnMainThread:@selector(layout) withObject:nil waitUntilDone:NO modes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
[self performSelectorOnMainThread:@selector(relayout) withObject:nil waitUntilDone:NO modes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
}
}
}
Expand Down

0 comments on commit 1012866

Please sign in to comment.