MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / interpolate

Function interpolate

plugins/single_plugins/vswipe.cpp:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31};
32
33static inline wf::geometry_t interpolate(wf::geometry_t a, wf::geometry_t b,
34 double xalpha, double yalpha)
35{
36 const auto& interp =
37 [=] (int32_t wf::geometry_t::*member, double alpha) -> int32_t
38 {
39 return std::round((1 - alpha) * a.*member + alpha * b.*member);
40 };
41
42 return {
43 interp(&wf::geometry_t::x, xalpha),
44 interp(&wf::geometry_t::y, yalpha),
45 interp(&wf::geometry_t::width, xalpha),
46 interp(&wf::geometry_t::height, yalpha)
47 };
48}
49
50class vswipe : public wf::per_output_plugin_instance_t
51{

Callers 2

vswipeClass · 0.70
handle_input_pressMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected