| 21 | #include "piuAll.h" |
| 22 | |
| 23 | void PiuRectangleApplyAspect(PiuRectangle r0, PiuRectangle r1, PiuRectangle r2, PiuAspect aspect) |
| 24 | { |
| 25 | if (!PiuRectangleIsEqual(r1, r2)) { |
| 26 | if (aspect & piuAspectFill) { |
| 27 | if (aspect & piuAspectFit) |
| 28 | *r0 = *r2; |
| 29 | else |
| 30 | PiuRectangleScaleToFill(r0, r1, r2); |
| 31 | } |
| 32 | else { |
| 33 | if (aspect & piuAspectFit) |
| 34 | PiuRectangleScaleToFit(r0, r1, r2); |
| 35 | else { |
| 36 | #ifdef piuPC |
| 37 | r0->x = r2->x + ((r2->width - r1->width) / 2); |
| 38 | r0->y = r2->y + ((r2->height - r1->height) / 2); |
| 39 | #else |
| 40 | r0->x = r2->x + ((r2->width - r1->width) >> 1); |
| 41 | r0->y = r2->y + ((r2->height - r1->height) >> 1); |
| 42 | #endif |
| 43 | r0->width = r1->width; |
| 44 | r0->height = r1->height; |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | void PiuRectangleApplyMargins(PiuRectangle r0, PiuRectangle r1, PiuMargins margins) |
| 51 | { |
nothing calls this directly
no test coverage detected