MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / set_viewing_area

Method set_viewing_area

src/DrawCamera.cpp:49–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void DrawCamera::set_viewing_area(Vector2f viewingAreaNew) {
50 viewingArea = viewingAreaNew;
51 float maxDim = std::max(viewingArea.x(), viewingArea.y());
52 WorldScalar a = WorldScalar(maxDim * 0.708f) * c.inverseScale;
53 WorldVec center = c.from_space(viewingArea * 0.5f);
54 viewingAreaGenerousCollider = SCollision::AABB<WorldScalar>(center - WorldVec{a, a}, center + WorldVec{a, a});
55}
56
57void DrawCamera::smooth_move_to(World& w, const CoordSpaceHelper& newCoords, Vector2f windowSize, bool instantJump) {
58 smoothMove.start = c;

Callers 6

take_screenshot_svgFunction · 0.80
take_screenshot_area_hwFunction · 0.80
WorldMethod · 0.80
draw_componentsMethod · 0.80
refresh_draw_cacheMethod · 0.80

Calls 3

xMethod · 0.45
yMethod · 0.45
from_spaceMethod · 0.45

Tested by

no test coverage detected