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

Method smooth_move_to

src/DrawCamera.cpp:57–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void DrawCamera::smooth_move_to(World& w, const CoordSpaceHelper& newCoords, Vector2f windowSize, bool instantJump) {
58 smoothMove.start = c;
59 smoothMove.end = newCoords;
60 smoothMove.endWindowSize = windowSize;
61 smoothMove.startCenter = c.pos + c.dir_from_space(w.main.window.size.cast<float>() * 0.5f);
62 smoothMove.endCenter = newCoords.pos + newCoords.dir_from_space(windowSize * 0.5f);
63
64 float a1(w.main.window.size.x() / windowSize.x());
65 float a2(w.main.window.size.y() / windowSize.y());
66 smoothMove.endUniformZoom = std::max(smoothMove.end.inverseScale.multiply_double((a1 < a2) ? a1 : a2), WorldScalar(1));
67
68 smoothMove.occurring = true;
69 smoothMove.moveTime = (instantJump || w.main.conf.jumpTransitionTime <= 0.01f) ? w.main.conf.jumpTransitionTime : 0.0f;
70}
71
72void DrawCamera::scale_up(World& w, const WorldScalar& scaleUpAmount) {
73 smoothMove.occurring = false;

Callers 5

player_listMethod · 0.80
init_clientMethod · 0.80
jump_toMethod · 0.80
set_gridMethod · 0.80

Calls 4

dir_from_spaceMethod · 0.80
xMethod · 0.45
yMethod · 0.45
multiply_doubleMethod · 0.45

Tested by

no test coverage detected