MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / paint

Method paint

Source/UIComponents/CtrlrComponents/Groups/CtrlrGroup.cpp:95–128  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

93
94//==============================================================================
95void CtrlrGroup::paint (Graphics& g)
96{
97 //[UserPrePaint] Add your own custom painting code here..
98 //[/UserPrePaint]
99
100 //[UserPaint] Add your own custom painting code here..
101 Rectangle<int> r = getUsableRect();
102
103 gradientFromProperty(g, getBounds(), getObjectTree(), Ids::uiGroupOutlineGradientType, Ids::uiGroupOutlineColour1, Ids::uiGroupOutlineColour2);
104 g.drawRoundedRectangle (r.toFloat().reduced((float)getProperty(Ids::uiGroupOutlineThickness)/2.0f), getProperty(Ids::uiGroupOutlineRoundAngle), getProperty(Ids::uiGroupOutlineThickness));
105
106 gradientFromProperty(g, getBounds(), getObjectTree(), Ids::uiGroupBackgroundGradientType, Ids::uiGroupBackgroundColour1, Ids::uiGroupBackgroundColour2);
107 g.fillRoundedRectangle (r.toFloat().reduced((float)getProperty(Ids::uiGroupOutlineThickness)/2.0f), getProperty(Ids::uiGroupOutlineRoundAngle));
108
109 if (groupBackgroundImage.isValid())
110 {
111 if ((int)getProperty (Ids::uiGroupBackgroundImageLayout) == 8192)
112 {
113 g.setTiledImageFill (groupBackgroundImage, 0, 0, (float)getProperty (Ids::uiGroupBackgroundImageAlpha)/255.0f);
114 g.fillRect(r);
115 }
116 else
117 {
118 g.setColour (Colours::black.withAlpha ((float)getProperty (Ids::uiGroupBackgroundImageAlpha)/255.0f));
119 g.drawImageWithin (groupBackgroundImage,
120 r.getX(),
121 r.getY(),
122 r.getWidth(),
123 r.getHeight(),
124 RectanglePlacement(getProperty (Ids::uiGroupBackgroundImageLayout)));
125 }
126 }
127 //[/UserPaint]
128}
129
130void CtrlrGroup::resized()
131{

Callers

nothing calls this directly

Calls 15

gradientFromPropertyFunction · 0.85
RectanglePlacementFunction · 0.85
drawRoundedRectangleMethod · 0.80
reducedMethod · 0.80
fillRoundedRectangleMethod · 0.80
setTiledImageFillMethod · 0.80
withAlphaMethod · 0.80
drawImageWithinMethod · 0.80
getBoundsFunction · 0.50
toFloatMethod · 0.45
isValidMethod · 0.45
fillRectMethod · 0.45

Tested by

no test coverage detected