Copy link to clipboard
Copied
GDB is reciving signal: "EXC_BAD_ACESS" when I try to transform a TextFrameArt using the TransformArtSuite. Here is an exampke code.
(Note I'still with CS5 SDK.)
AIErr
SetPointTextMatrix( AIArtHandle textArt, AIRealMatrix *matrix)
{
AIErr error = kNoErr;
int textType;
VMGetTextType( textArt, &textType);
if (textType == kPointTextType)
{
/* since we cannot set the matrix directly, we need to calculate a
tranformation and transform the object:
Let C be the <currentMatrix>
Let R be the final <matrix>
Let T be the <transformation> matrix
Since,
R = C * T
then we can calulate
T = inv(C) * R
*/
AIRealMatrix currentMatrix, transformation;
GetPointTextMatrix( textArt, ¤tMatrix);
sMath->AIRealMatrixInvert( ¤tMatrix);
sMath->AIRealMatrixConcat( ¤tMatrix, matrix, &transformation);
/* THIS IS WHERE IT ALL GOES WRONG: - the content of the <transformation> matrix is OK */
error = sTransformArt->TransformArt( textArt, &transformation, 1.0, kTransformObjects));
}
return error;
}
Anyone know why?
My guess would be that there was a problem obtaining the Transform Art Suite so sTransformArt is not valid.
Copy link to clipboard
Copied
My guess would be that there was a problem obtaining the Transform Art Suite so sTransformArt is not valid.
Copy link to clipboard
Copied
I looked into it, and thought it was OK, But eventually I found the cultprit: a missing "&".
...
kAIRealMathSuite, kAIRealMathVersion, &sMath, | |
kAIHardSoftSuite, kAIHardSoftSuiteVersion, &sHardSoft, | |
kAITransformArtSuite, kAITransformArtSuiteVersion, sTransformArt, <- missing "&". | |
kAIArtStyleSuite, kAIArtStyleSuiteVersion, &sArtStyle, | |
kAIBlendStyleSuite, kAIBlendStyleSuiteVersion, &sBlendStyle, |
...
Agnar