MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / UpdateDimensions

Method UpdateDimensions

Source/RadioButton.cpp:102–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void RadioButton::UpdateDimensions()
103{
104 if (mDirection == kRadioVertical)
105 {
106 for (int i = 0; i < mElements.size(); ++i)
107 {
108 int width = GetStringWidth(mElements[i].mLabel) + 5;
109 if (width > mWidth)
110 mWidth = width;
111 }
112 mHeight = radioSpacing * (int)mElements.size();
113 mElementWidth = mWidth;
114 }
115 else
116 {
117 for (int i = 0; i < mElements.size(); ++i)
118 {
119 int width = GetStringWidth(mElements[i].mLabel) + 5;
120 if (width > mElementWidth)
121 mElementWidth = width;
122 }
123 mWidth = mElementWidth * (int)mElements.size();
124 mHeight = radioSpacing;
125 }
126
127 if (mForcedWidth != -1)
128 mWidth = mForcedWidth;
129}
130
131void RadioButton::Clear()
132{

Callers

nothing calls this directly

Calls 2

GetStringWidthFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected