mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
fix scrolling
This commit is contained in:
parent
6e1345ede9
commit
b03dd98209
1 changed files with 5 additions and 4 deletions
|
|
@ -135,9 +135,10 @@ void GUI::actMouse(float delta, const CursorState& cursor) {
|
||||||
if (this->hover && this->hover != hover) {
|
if (this->hover && this->hover != hover) {
|
||||||
this->hover->setMouseEnter(false);
|
this->hover->setMouseEnter(false);
|
||||||
}
|
}
|
||||||
if (hover && hover != this->hover) {
|
if (hover) {
|
||||||
hover->setMouseEnter(true);
|
if (hover != this->hover) {
|
||||||
|
hover->setMouseEnter(true);
|
||||||
|
}
|
||||||
int scroll = input.getScroll();
|
int scroll = input.getScroll();
|
||||||
if (scroll) {
|
if (scroll) {
|
||||||
hover->scrolled(scroll);
|
hover->scrolled(scroll);
|
||||||
|
|
@ -269,7 +270,7 @@ void GUI::draw(const DrawContext& pctx, const Assets& assets) {
|
||||||
auto& page = menu->getCurrent();
|
auto& page = menu->getCurrent();
|
||||||
if (page.panel) {
|
if (page.panel) {
|
||||||
menu->setSize(page.panel->getSize());
|
menu->setSize(page.panel->getSize());
|
||||||
page.panel->refresh();
|
// page.panel->refresh();
|
||||||
if (auto panel = std::dynamic_pointer_cast<gui::Panel>(page.panel)) {
|
if (auto panel = std::dynamic_pointer_cast<gui::Panel>(page.panel)) {
|
||||||
panel->cropToContent();
|
panel->cropToContent();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue