MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / applyRect

Method applyRect

Source/Support/Geometry.cpp:353–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353Rect 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
372AffineTransform& AffineTransform::translate(float tx, float ty) {
373 r_cast<ktm::faffine2d*>(this)->translate(tx, ty);

Callers

nothing calls this directly

Calls 7

reduce_minClass · 0.85
reduce_maxClass · 0.85
getBottomMethod · 0.80
getTopMethod · 0.80
RectClass · 0.70
getLeftMethod · 0.45
getRightMethod · 0.45

Tested by

no test coverage detected