I have a
Rectangle rect = new Rectangle(
(int)(someArray[z].rectangleObject.X +
((double)widthOfCell / 2) -
((double)targetWidth / 2)),
(int)(someArray[z].rectangleObject.Y +
(double)(heightOfCell / 2) -
(double)(targetHeight / 2)),
targetWidth,
targetHeight);
If targetWidth
and targetHeight
increase by 20 per cent, ie
targetWidth *= 1.2
targetHeight *= 1.2
How does
(int)(someArray[z].rectangleObject.X +
((double)widthOfCell / 2) - ((double)targetWidth / 2))
and
(int)(someArray[z].rectangleObject.Y +
(double)(heightOfCell / 2) - (double)(targetHeight / 2))
have to change for the center to stay in the same place?
Note that I am not changing any of the other values in the calculation. someArray[z].rectangleObject.X
, someArray[z].rectangleObject.Y
, widthOfCell
and heightOfCell
all remain the same.