1 | initial version |
Okay to provide a solution to your problem, starting from the following facts:
Which makes point 2 quite useless. If I am wrong here, then please provide explanation of what p0, p1 and p2 are.
Then the following code will work perfectly:
int width = p1.x - p0.x;
int height = p1.y - p0.h;
However your functions seem more complex and I am guessing you do not have a bounding box yet. SO like said before, could you give the code leading to those 3 points and explain what they are?