1 | initial version |
The x and y in a Rect object refer to the upper left hand corner. If you want the new Rect to be centered on the priorCenter point, you need to use something like this:
Rect face(priorCenter.x-priorCenter.width/2,priorCenter.y-priorCenter.height/2,priorCenter.width,priorCenter.height);
Depending on the types, you may need to do some static casts to get all the types right after division.