MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / reshape

Method reshape

engine/src/camera.cpp:48–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void Camera::reshape(float w, float h)
49{
50 float dw = w - size.x;
51 float dh = h - size.y;
52 float cx = position.x + size.x / 2;
53 float cy = position.y + size.y / 2;
54 size.x += dw;
55 size.y += dh;
56 position.x = cx - size.x / 2;
57 position.y = cy - size.y / 2;
58}
59
60void Camera::moveToTarget()
61{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected