MCPcopy Create free account
hub / github.com/christophhart/HISE / getBoundsToDisplay

Method getBoundsToDisplay

hi_scripting/scripting/scriptnode/api/NodeBase.cpp:331–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331juce::Rectangle<int> NodeBase::getBoundsToDisplay(Rectangle<int> originalHeight) const
332{
333 auto titleWidth = GLOBAL_BOLD_FONT().getStringWidthFloat(getName());
334 auto minWidth = jmax<int>(UIValues::NodeWidth, titleWidth + UIValues::HeaderHeight * 4);
335
336 if (v_data[PropertyIds::Folded])
337 {
338
339 originalHeight = originalHeight.withHeight(UIValues::HeaderHeight).withWidth(minWidth);
340 }
341
342 if(originalHeight.getWidth() < minWidth)
343 originalHeight.setWidth(minWidth);
344
345 auto helpBounds = helpManager.getHelpSize().toNearestInt();
346
347 if (!helpBounds.isEmpty())
348 {
349 if(!helpManager.isHelpBelow())
350 {
351 originalHeight.setWidth(originalHeight.getWidth() + helpBounds.getWidth());
352 originalHeight.setHeight(jmax<int>(originalHeight.getHeight(), helpBounds.getHeight()));
353 }
354 else
355 {
356 originalHeight.setWidth(jmax<int>(originalHeight.getWidth(), helpBounds.getWidth()));
357 originalHeight.setHeight(originalHeight.getHeight() + helpBounds.getHeight());
358 }
359 }
360
361 if (getRootNetwork()->getExceptionHandler().getErrorMessage(this).isNotEmpty())
362 originalHeight.setHeight(jmax(originalHeight.getHeight(), 150));
363
364 return originalHeight;
365}
366
367
368

Callers

nothing calls this directly

Calls 15

jmaxFunction · 0.85
toNearestIntMethod · 0.80
getHelpSizeMethod · 0.80
isHelpBelowMethod · 0.80
getNameFunction · 0.50
getStringWidthFloatMethod · 0.45
withWidthMethod · 0.45
withHeightMethod · 0.45
getWidthMethod · 0.45
setWidthMethod · 0.45
isEmptyMethod · 0.45
setHeightMethod · 0.45

Tested by

no test coverage detected