MCPcopy Create free account
hub / github.com/DISTRHO/DPF / onResize

Method onResize

examples/CairoUI/CairoExampleUI.cpp:90–107  ·  view source on GitHub ↗

we can use this if/when our resources are scalable, for now they are PNGs

Source from the content-addressed store, hash-verified

88#if 0
89 // we can use this if/when our resources are scalable, for now they are PNGs
90 void onResize(const ResizeEvent& ev) override
91 {
92 UI::onResize(ev);
93
94 const double scaleFactor = getScaleFactor();
95
96 fWidgetClickable->setSize(50*scaleFactor, 50*scaleFactor);
97 fWidgetClickable->setAbsolutePos(100*scaleFactor, 100*scaleFactor);
98
99 fWidgetBanner->setSize(180*scaleFactor, 80*scaleFactor);
100 fWidgetBanner->setAbsolutePos(10*scaleFactor, 10*scaleFactor);
101
102 fKnob->setSize(80*scaleFactor, 80*scaleFactor);
103 fKnob->setAbsolutePos(10*scaleFactor, 100*scaleFactor);
104
105 fButton->setSize(60*scaleFactor, 35*scaleFactor);
106 fButton->setAbsolutePos(100*scaleFactor, 160*scaleFactor);
107 }
108#endif
109
110 void parameterChanged(const uint32_t index, const float value) override

Callers

nothing calls this directly

Calls 4

onResizeFunction · 0.50
getScaleFactorFunction · 0.50
setSizeMethod · 0.45
setAbsolutePosMethod · 0.45

Tested by

no test coverage detected