| 518 | | rect.size = [self _scaledImageSizeForSize:size bounds:bounds.size]; |
|---|
| 519 | | rect.origin.x = floorf((bounds.size.width - rect.size.width) / 2.0); |
|---|
| 520 | | rect.origin.y = floorf((bounds.size.height - rect.size.height) / 2.0); |
|---|
| | 518 | rect.size = size = [self _scaledImageSizeForSize:size bounds:bounds.size]; |
|---|
| | 519 | |
|---|
| | 520 | if(_imageRotation == 0.0) { |
|---|
| | 521 | rect.origin.x = floorf((bounds.size.width - size.width) / 2.0); |
|---|
| | 522 | rect.origin.y = floorf((bounds.size.height - size.height) / 2.0); |
|---|
| | 523 | } |
|---|
| | 524 | else if(_imageRotation == 90.0) { |
|---|
| | 525 | rect.origin.x = floorf((bounds.size.width - size.height) / 2.0); |
|---|
| | 526 | rect.origin.y = rect.size.width + floorf((bounds.size.height - size.width) / 2.0); |
|---|
| | 527 | } |
|---|
| | 528 | else if(_imageRotation == 180.0) { |
|---|
| | 529 | rect.origin.x = rect.size.width + floorf((bounds.size.width - size.width) / 2.0); |
|---|
| | 530 | rect.origin.y = rect.size.height + floorf((bounds.size.height - size.height) / 2.0); |
|---|
| | 531 | } |
|---|
| | 532 | else if(_imageRotation == 270.0) { |
|---|
| | 533 | rect.origin.x = rect.size.height + floorf((bounds.size.width - size.height) / 2.0); |
|---|
| | 534 | rect.origin.y = floorf((bounds.size.height - size.width) / 2.0); |
|---|
| | 535 | } |
|---|