MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / getRect

Method getRect

src/Core/Graphics/Sprite.cpp:306–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304 }
305
306 Transform::Rect Sprite::getRect()
307 {
308 const Transform::UnitVector pxPosition
309 = Rect::m_position.to<Transform::Units::ScenePixels>();
310 const Transform::UnitVector pxSize(m_sprite.getGlobalBounds().width,
311 m_sprite.getGlobalBounds().height, Transform::Units::ScenePixels);
312
313 m_sprite.setPosition(pxPosition.x, pxPosition.y);
314 Transform::Rect rect = Transform::Rect(pxPosition, pxSize);
315 rect.setPosition(Transform::UnitVector(m_sprite.getGlobalBounds().left,
316 m_sprite.getGlobalBounds().top, Transform::Units::ScenePixels));
317 return rect;
318 }
319
320 void Sprite::setVisible(bool visible)
321 {

Callers

nothing calls this directly

Calls 4

UnitVectorClass · 0.85
RectClass · 0.50
getGlobalBoundsMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected