| 351 | } |
| 352 | |
| 353 | Rect AffineTransform::applyRect(const Rect& rect) const { |
| 354 | float bottom = rect.getBottom(); |
| 355 | float left = rect.getLeft(); |
| 356 | float right = rect.getRight(); |
| 357 | float top = rect.getTop(); |
| 358 | |
| 359 | Vec2 topLeft = applyPoint({left, top}); |
| 360 | Vec2 topRight = applyPoint({right, top}); |
| 361 | Vec2 bottomLeft = applyPoint({left, bottom}); |
| 362 | Vec2 bottomRight = applyPoint({right, bottom}); |
| 363 | |
| 364 | float minX = ktm::reduce_min(ktm::fvec4{topLeft.x, topRight.x, bottomLeft.x, bottomRight.x}); |
| 365 | float maxX = ktm::reduce_max(ktm::fvec4{topLeft.x, topRight.x, bottomLeft.x, bottomRight.x}); |
| 366 | float minY = ktm::reduce_min(ktm::fvec4{topLeft.y, topRight.y, bottomLeft.y, bottomRight.y}); |
| 367 | float maxY = ktm::reduce_max(ktm::fvec4{topLeft.y, topRight.y, bottomLeft.y, bottomRight.y}); |
| 368 | |
| 369 | return Rect(minX, minY, (maxX - minX), (maxY - minY)); |
| 370 | } |
| 371 | |
| 372 | AffineTransform& AffineTransform::translate(float tx, float ty) { |
| 373 | r_cast<ktm::faffine2d*>(this)->translate(tx, ty); |
nothing calls this directly
no test coverage detected