What steps will reproduce the problem?
1. Create a pie chart an run in the iPad (not the emulator)
2. Do not set a shadow on the pie chart
3. Add labels to the slices
What is the expected output? What do you see instead?
Watching in the debugger, expect ShadowOffset to be 0.0. It is coming out as
NAN instead. This is likely random based upon existing memory. This causes a
SIGABT later in the rendering code.
What version of the product are you using? On what operating system?
This is the current mercury trunk version. I checked the code in browse and it
looks unmodified. It ran OK in the iPad emulator, but failed on the iPad
itself.
Please provide any additional information below.
I modified the code like below and it resolved the issue:
-(CGSize)sizeThatFits
{
if ( self.text == nil ) return CGSizeZero;
CGSize textSize = [self.text sizeWithTextStyle:self.textStyle];
//TRS - When self.shadow is nil, self.shadow.shadowOffset was returning in the iPad with a width of NAN.
CGSize shadowOffset = CGSizeMake(0.0f, 0.0f);
CGFloat shadowRadius = 0.0f;
if (self.shadow != nil)
{
CPTShadow *myShadow = self.shadow;
shadowOffset = myShadow.shadowOffset;
shadowRadius = myShadow.shadowBlurRadius;
}
// Add small margin
textSize.width += (ABS(shadowOffset.width) + shadowRadius + kCPTTextLayerMarginWidth) * 2.0;
textSize.width = ceil(textSize.width);
textSize.height += (ABS(shadowOffset.height) + shadowRadius + kCPTTextLayerMarginWidth) * 2.0;
textSize.height = ceil(textSize.height);
return textSize;
}
Original issue reported on code.google.com by ProfVonL...@gmail.com on 21 Aug 2011 at 7:04
Original issue reported on code.google.com by
ProfVonL...@gmail.com
on 21 Aug 2011 at 7:04