minor refactor Button
This commit is contained in:
@@ -27,6 +27,17 @@ int Panel::getMinLength() const {
|
||||
return minLength;
|
||||
}
|
||||
|
||||
void Panel::setContentSize(const glm::ivec2& contentSize) {
|
||||
setSize(glm::vec2(
|
||||
glm::max(padding.x + padding.z + contentSize.x, size.x),
|
||||
glm::max(padding.y + padding.w + contentSize.y, size.y)
|
||||
));
|
||||
}
|
||||
|
||||
glm::vec2 Panel::getContentSize() const {
|
||||
return size - glm::vec2(padding.z + padding.x, padding.w + padding.y);
|
||||
}
|
||||
|
||||
void Panel::cropToContent() {
|
||||
if (maxLength > 0.0f) {
|
||||
setSize(glm::vec2(
|
||||
|
||||
Reference in New Issue
Block a user