Commit b827ec88bf1a4efd66a9aa5ff6f7c54a611a3a7c
1 parent
de39cbf9
preserve rect aspect ratio
Showing
1 changed file
with
4 additions
and
4 deletions
openbr/plugins/metadata/checkrects.cpp
| @@ -42,10 +42,10 @@ class CheckRectsTransform : public UntrainableTransform | @@ -42,10 +42,10 @@ class CheckRectsTransform : public UntrainableTransform | ||
| 42 | if (fixRects){ | 42 | if (fixRects){ |
| 43 | for (int i=0; i<rects.size(); i++) { | 43 | for (int i=0; i<rects.size(); i++) { |
| 44 | QRectF r = rects[i]; | 44 | QRectF r = rects[i]; |
| 45 | - if (r.left() < 0) r.setLeft(0); | ||
| 46 | - if (r.right() > src.m().cols-1) r.setRight(src.m().cols-1); | ||
| 47 | - if (r.top() < 0) r.setTop(0); | ||
| 48 | - if (r.bottom() > src.m().rows-1) r.setBottom(src.m().rows-1); | 45 | + if (r.left() < 0) r.moveLeft(0); |
| 46 | + if (r.right() > src.m().cols-1) r.moveRight(src.m().cols-1); | ||
| 47 | + if (r.top() < 0) r.moveTop(0); | ||
| 48 | + if (r.bottom() > src.m().rows-1) r.moveBottom(src.m().rows-1); | ||
| 49 | dst.file.appendRect(r); | 49 | dst.file.appendRect(r); |
| 50 | } | 50 | } |
| 51 | } else { | 51 | } else { |