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

Method getResizeHints

distrho/src/DistrhoPluginCLAP.cpp:315–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313 }
314
315 bool getResizeHints(clap_gui_resize_hints_t* const hints) const
316 {
317 if (fUI != nullptr && fUI->isResizable())
318 {
319 uint minimumWidth, minimumHeight;
320 bool keepAspectRatio;
321 fUI->getGeometryConstraints(minimumWidth, minimumHeight, keepAspectRatio);
322
323 #ifdef DISTRHO_OS_MAC
324 const double scaleFactor = fUI->getScaleFactor();
325 minimumWidth /= scaleFactor;
326 minimumHeight /= scaleFactor;
327 #endif
328
329 hints->can_resize_horizontally = true;
330 hints->can_resize_vertically = true;
331 hints->preserve_aspect_ratio = keepAspectRatio;
332 hints->aspect_ratio_width = minimumWidth;
333 hints->aspect_ratio_height = minimumHeight;
334
335 return true;
336 }
337
338 hints->can_resize_horizontally = false;
339 hints->can_resize_vertically = false;
340 hints->preserve_aspect_ratio = false;
341 hints->aspect_ratio_width = 0;
342 hints->aspect_ratio_height = 0;
343
344 return false;
345 }
346
347 bool adjustSize(uint32_t* const width, uint32_t* const height) const
348 {

Callers 1

Calls 3

isResizableMethod · 0.45
getScaleFactorMethod · 0.45

Tested by

no test coverage detected