mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
feat: horizontal scroll
This commit is contained in:
parent
2448869bf9
commit
863cc923a0
4 changed files with 26 additions and 19 deletions
|
|
@ -41,10 +41,10 @@ glm::vec2 Panel::getContentSize() const {
|
|||
void Panel::cropToContent() {
|
||||
if (maxLength > 0.0f) {
|
||||
setSize(glm::vec2(
|
||||
getSize().x, glm::max(minLength, glm::min(maxLength, actualLength))
|
||||
glm::max(minLength, glm::min(maxLength, actualLengthX)), glm::max(minLength, glm::min(maxLength, actualLengthY))
|
||||
));
|
||||
} else {
|
||||
setSize(glm::vec2(getSize().x, glm::max(minLength, actualLength)));
|
||||
setSize(glm::vec2(glm::max(minLength, actualLengthX), glm::max(minLength, actualLengthY)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +93,8 @@ void Panel::refresh() {
|
|||
y += nodeSize.y + margin.w + interval;
|
||||
maxw = fmax(maxw, ex + nodeSize.x + margin.z + padding.z);
|
||||
}
|
||||
actualLength = y + padding.w;
|
||||
actualLengthX = size.x;
|
||||
actualLengthY = y + padding.w;
|
||||
} else {
|
||||
float maxh = size.y;
|
||||
for (auto& node : nodes) {
|
||||
|
|
@ -115,6 +116,7 @@ void Panel::refresh() {
|
|||
x += nodesize.x + margin.z + interval;
|
||||
maxh = fmax(maxh, ey + nodesize.y + margin.w + padding.w);
|
||||
}
|
||||
actualLength = size.y;
|
||||
actualLengthY = size.y;
|
||||
actualLengthX = x + padding.z;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue