MCPcopy Create free account
hub / github.com/VCVRack/Rack / createWidgetCentered

Function createWidgetCentered

include/helpers.hpp:61–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59/** Creates a Widget subclass with its center at a position. */
60template <class TWidget>
61TWidget* createWidgetCentered(math::Vec pos) {
62 TWidget* o = createWidget<TWidget>(pos);
63 o->box.pos = o->box.pos.minus(o->box.size.div(2));
64 return o;
65}
66
67
68/** Creates an SvgPanel and loads the SVG from the given path. */

Callers

nothing calls this directly

Calls 2

minusMethod · 0.80
divMethod · 0.80

Tested by

no test coverage detected