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

Method paint

hi_scripting/scripting/scriptnode/ui/NodeContainerComponent.cpp:847–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845}
846
847void SerialNodeComponent::paint(Graphics& g)
848{
849 auto b = getLocalBounds().toFloat();
850
851 auto t = JUCE_LIVE_CONSTANT_OFF(1000.0f);
852 signalDotOffset = (double)Time::getMillisecondCounter() / jmax(1.0f, t);
853
854
855 Colour fc = getOutlineColour();
856
857 g.setColour(JUCE_LIVE_CONSTANT_OFF(Colour(0xff232323)));
858
859 g.fillRect(b);
860
861 g.setGradientFill(ColourGradient(JUCE_LIVE_CONSTANT_OFF(Colour(0x22000000)), 0.0f, (float)UIValues::HeaderHeight, Colours::transparentBlack, 0.0f, 50.0f, false));
862
863 auto copy = b;
864 g.fillRect(copy.removeFromTop(50.0f));
865
866 g.setColour(fc);
867 g.drawRect(b, 1.0f);
868
869 int yStart = 0;
870
871 if (auto ng = findParentComponentOfClass<DspNetworkGraph>())
872 {
873 yStart = (ng->getLocalArea(this, getLocalBounds()).getY() + 15 + UIValues::HeaderHeight) % 10;
874 }
875
876 for (int i = yStart; i < getHeight() + 10; i += 10)
877 {
878 float multiplier = (float)i / float(getHeight());
879 multiplier += JUCE_LIVE_CONSTANT_OFF(0.5f);
880 g.setColour(fc.withMultipliedAlpha( multiplier * JUCE_LIVE_CONSTANT_OFF(0.08f)));
881 g.fillRect(2, i, getWidth() - 2, 9 );
882 }
883
884 for (int i = 0; i < node->getNumChannelsToDisplay(); i++)
885 {
886 paintSerialCable(g, i);
887 }
888
889 drawHelp(g);
890
891 if (addPosition != -1)
892 {
893 g.fillAll(Colours::white.withAlpha(0.01f));
894
895 g.setColour(Colours::white.withAlpha(0.08f));
896 g.fillRoundedRectangle(getInsertRuler(addPosition), 2.5f);
897 }
898
899 if (insertPosition != -1)
900 {
901 g.setColour(Colour(SIGNAL_COLOUR).withAlpha(0.05f));
902 g.fillRoundedRectangle(getLocalBounds().toFloat(), 5.0f);
903
904 g.setColour(Colour(SIGNAL_COLOUR));

Callers

nothing calls this directly

Calls 15

jmaxFunction · 0.85
ColourFunction · 0.85
getHeightFunction · 0.50
getWidthFunction · 0.50
absFunction · 0.50
toFloatMethod · 0.45
setColourMethod · 0.45
fillRectMethod · 0.45
setGradientFillMethod · 0.45
removeFromTopMethod · 0.45
drawRectMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected