mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
Merge branch 'main' into animation
This commit is contained in:
commit
8c1d8bd794
24 changed files with 56 additions and 50 deletions
|
|
@ -145,6 +145,9 @@ private:
|
|||
|
||||
// Does block allow to see other blocks sides (is it transparent)
|
||||
bool isOpen(const glm::ivec3& pos, const Block& def, const Variant& variant) const {
|
||||
if (pos.y >= CHUNK_H) {
|
||||
return true;
|
||||
}
|
||||
const auto& vox = voxelsBuffer->pickBlock(
|
||||
chunk->x * CHUNK_W + pos.x, pos.y, chunk->z * CHUNK_D + pos.z
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ namespace gui {
|
|||
virtual ~BasePanel() = default;
|
||||
|
||||
virtual void setOrientation(Orientation orientation) {
|
||||
this->mainScrollDir = orientation;
|
||||
this->orientation = orientation;
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ void Container::act(float delta) {
|
|||
|
||||
void Container::scrolled(int value) {
|
||||
auto size = getSize();
|
||||
bool isVertical = actualLengthY > size.y;
|
||||
bool isVertical = mainScrollDir == Orientation::VERTICAL;
|
||||
int diff = (isVertical ? actualLengthY - size.y : actualLengthX - size.x);
|
||||
int& scroll = (isVertical ? scrollY : scrollX);
|
||||
|
||||
|
|
@ -245,6 +245,7 @@ void Container::setSize(const glm::vec2& size) {
|
|||
for (auto& node : nodes) {
|
||||
node->reposition();
|
||||
}
|
||||
scrolled(0);
|
||||
}
|
||||
|
||||
int Container::getScrollStep() const {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace gui {
|
|||
int actualLengthY = 0;
|
||||
int actualLengthX = 0;
|
||||
bool scrollable = true;
|
||||
Orientation mainScrollDir = Orientation::VERTICAL;
|
||||
|
||||
bool isScrolling() const {
|
||||
return scrollbarTriggered;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue