| 644 | // ---------------------------------------------------------------------------------------- |
| 645 | |
| 646 | inline const rectangle scale_rect ( |
| 647 | const rectangle& rect, |
| 648 | double scale |
| 649 | ) |
| 650 | { |
| 651 | DLIB_ASSERT(scale > 0, "scale factor must be > 0"); |
| 652 | |
| 653 | const long l = std::lround(rect.left()*scale); |
| 654 | const long t = std::lround(rect.top()*scale); |
| 655 | const long r = std::lround(rect.right()*scale); |
| 656 | const long b = std::lround(rect.bottom()*scale); |
| 657 | return rectangle(l, t, r, b); |
| 658 | } |
| 659 | |
| 660 | // ---------------------------------------------------------------------------------------- |
| 661 | |