| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I was calculating a bounding box and thought I would initialize the box to zero.
However, this gives the wrong result!
HIRect hiRect1 = {{0.0}};
HIRect hiRect2 = {{1.0}};
hiRect1 = CGRectUnion( hiRect1, hiRect2 );
// Now hiRect1 = {{0.0,0.0},{2.0,2.0}} !
So one has to write
if ( !<x-tad-bigger>CGRectIsEmpty</x-tad-bigger>(hiRect1)) hiRect1 = CGRectUnion( hiRect1, hiRect2 );
else hiRect1 = hiRect2;
OTOH this means you can calculate the bounding box of a number of points with CGRectUnion!
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden This email sent to email@hidden
| References: | |
| >Empty rect contributes to bounding box (From: "Jan E. Schotsman" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.