mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
minor refactor Button
This commit is contained in:
parent
ead46158d9
commit
f473df33fb
4 changed files with 29 additions and 17 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue