92 VuoPoint2d _labelPadding,
105 minimumWidth = _minimumWidth;
106 minimumHeight = _minimumHeight;
107 labelFont = _labelFont;
109 labelPosition = _labelPosition;
110 labelPadding = _labelPadding;
111 labelColor = _labelColor;
112 labelColorHovered = _labelColorHovered;
113 labelColorPressed = _labelColorPressed;
114 backgroundColor = _backgroundColor;
115 backgroundColorHovered = _backgroundColorHovered;
116 backgroundColorPressed = _backgroundColorPressed;
117 borderColor = _borderColor;
118 borderColorHovered = _borderColorHovered;
119 borderColorPressed = _borderColorPressed;
120 borderThickness = _borderThickness;
121 cornerRoundness = _cornerRoundness;
134 json_object_object_add(json,
"minimumWidth",
VuoReal_getJson(minimumWidth));
135 json_object_object_add(json,
"minimumHeight",
VuoReal_getJson(minimumHeight));
140 json_object_object_add(json,
"labelColorHovered",
VuoColor_getJson(labelColorHovered));
141 json_object_object_add(json,
"labelColorPressed",
VuoColor_getJson(labelColorPressed));
142 json_object_object_add(json,
"backgroundColor",
VuoColor_getJson(backgroundColor));
143 json_object_object_add(json,
"backgroundColorHovered",
VuoColor_getJson(backgroundColorHovered));
144 json_object_object_add(json,
"backgroundColorPressed",
VuoColor_getJson(backgroundColorPressed));
146 json_object_object_add(json,
"borderColorHovered",
VuoColor_getJson(borderColorHovered));
147 json_object_object_add(json,
"borderColorPressed",
VuoColor_getJson(borderColorPressed));
148 json_object_object_add(json,
"borderThickness",
VuoReal_getJson(borderThickness));
149 json_object_object_add(json,
"cornerRoundness",
VuoReal_getJson(cornerRoundness));
176 &&
VuoColor_areEqual(backgroundColorHovered, thatSpecialized->backgroundColorHovered)
177 &&
VuoColor_areEqual(backgroundColorPressed, thatSpecialized->backgroundColorPressed)
222 float actualWidth = minimumWidth;
223 float actualHeight = minimumHeight;
227 f.color = (
VuoColor){f.color.r * labelColorPressed.r,
228 f.color.g * labelColorPressed.g,
229 f.color.b * labelColorPressed.b,
230 f.color.a * labelColorPressed.a};
232 f.color = (
VuoColor){f.color.r * labelColorHovered.r,
233 f.color.g * labelColorHovered.g,
234 f.color.b * labelColorHovered.b,
235 f.color.a * labelColorHovered.a};
237 f.color = (
VuoColor){f.color.r * labelColor.r,
238 f.color.g * labelColor.g,
239 f.color.b * labelColor.b,
240 f.color.a * labelColor.a};
242 VuoPoint2d textSize = (VuoPoint2d){0,0};
247 actualWidth = fmax(actualWidth, textSize.x);
248 actualHeight = fmax(actualHeight, textSize.y);
253 actualWidth = fmax(actualWidth, textSize.x + labelPadding.x * 2);
254 actualHeight = fmax(actualHeight, textSize.y + labelPadding.y * 2);
256 actualWidth += borderThickness * 2;
257 actualHeight += borderThickness * 2;
266 float innerCornerRoundness = (actualHeight - borderThickness * 2 - (actualHeight * (1-cornerRoundness))) / (actualHeight - borderThickness * 2);
269 isPressed ? backgroundColorPressed : (isHovered ? backgroundColorHovered : backgroundColor),
272 actualWidth - borderThickness * 2,
273 actualHeight - borderThickness * 2,
275 innerCornerRoundness);
278 isPressed ? borderColorPressed : (isHovered ? borderColorHovered : borderColor),
289 offset.x = actualWidth * .5f;
291 offset.x = -actualWidth * .5f;
294 offset.y = -actualHeight * .5f;
296 offset.y = actualHeight * .5f;
307 (
VuoAnchor_getHorizontal(labelPosition) == VuoHorizontalAlignment_Left ? (-(actualWidth-labelPadding.x)) : (actualWidth-labelPadding.x)) * .5f,
312 (
VuoAnchor_getVertical(labelPosition) == VuoVerticalAlignment_Top ? (actualHeight-labelPadding.y) : (-(actualHeight-labelPadding.y))) * .5f,