223 {
224
226
228
229 if (this->values || this->max > this->min) {
230
232 int labelWidth = 0;
233 char text[64];
234
236
237
238
239 if (this->values) {
240 for (size_t i = 0; i < this->values->count; i++) {
241 int width;
242
243 const char *characters;
244 if (this->labels) {
245 characters = cast(String, $(this->labels, objectAtIndex, i))->chars;
246 } else {
247 snprintf(text, sizeof(text), this->labelFormat, VectorValue(this->values, double, i));
248 characters = text;
249 }
251
252 labelWidth = max(labelWidth, width);
253 }
254 } else {
255 int minWidth, maxWidth;
256
257 snprintf(text, sizeof(text), this->labelFormat, this->min);
259
260 snprintf(text, sizeof(text), this->labelFormat, this->max);
262
263 labelWidth = max(minWidth, maxWidth);
264 }
265
267 }
268
271
272 View *handle = (
View *) this->handle;
274 } else {
275 if (this->max < this->min) {
277 }
278 }
279}
static void sizeCharacters(const Font *self, const char *chars, int *w, int *h)
static double fractionOfValue(const Slider *self)
static SDL_Rect bounds(const View *self)
Font * font
The Font. A fixed-width Font carries a bitmap, and is drawn as one quad per glyph from its glyph shee...
ViewPadding padding
The padding.