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

Method paint

hi_scripting/scripting/scriptnode/ui/NodeComponent.cpp:310–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void NodeComponent::Header::paint(Graphics& g)
311{
312 auto textArea = getLocalBounds().toFloat();
313
314 auto leftMargin = 0.0f;
315 auto rightMargin = 0.0f;
316
317 g.setColour(parent.getOutlineColour());
318 g.fillAll();
319
320 auto b = getLocalBounds();
321 b.removeFromLeft(1);
322 b.removeFromRight(1);
323 b.removeFromTop(1);
324
325 g.setColour(JUCE_LIVE_CONSTANT_OFF(Colour(0x2b000000)));
326 g.fillRect(b);
327
328
329
330
331 String s;
332
333 g.setFont(GLOBAL_BOLD_FONT());
334
335 s << parent.dataReference[PropertyIds::Name].toString();
336
337 if (parent.node.get()->isPolyphonic())
338 s << " [poly]";
339
340 if (parent.node->getRootNetwork()->getCpuProfileFlag())
341 {
342 s << parent.node->getCpuUsageInPercent();
343 }
344
345 leftMargin += textArea.getHeight();
346
347 if(parameterButton.isVisible())
348 leftMargin += textArea.getHeight();
349
350 if(freezeButton.isVisible())
351 rightMargin += textArea.getHeight();
352
353
354 auto ar = getLocalBounds().toFloat();
355 ar.removeFromRight(ar.getHeight());
356
357 rightMargin += textArea.getHeight();
358
359 if (parent.node->isClone())
360 {
361 g.setColour(Colours::white.withAlpha(parent.node->isBypassed() ? 0.05f : 0.2f));
362 auto p = f.createPath("clone");
363 f.scalePath(p, ar.removeFromRight(ar.getHeight()).reduced(5.0f));
364
365 rightMargin += textArea.getHeight();
366
367 g.fillPath(p);

Callers

nothing calls this directly

Calls 15

ColourFunction · 0.85
jmaxFunction · 0.85
getRootNetworkMethod · 0.80
getCpuUsageInPercentMethod · 0.80
isCloneMethod · 0.80
scalePathMethod · 0.80
reducedMethod · 0.80
strokePathMethod · 0.80
getPixelSizeMethod · 0.80
toFloatMethod · 0.45
setColourMethod · 0.45
getOutlineColourMethod · 0.45

Tested by

no test coverage detected