Commit a7ac602b authored by mercury233's avatar mercury233

fix scrollbar

parent 331457c7
......@@ -637,6 +637,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case irr::EMIE_MOUSE_WHEEL: {
if(!mainGame->scrFilter->isVisible())
break;
if(mainGame->env->hasFocus(mainGame->scrFilter))
break;
irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement();
if(root->getElementFromPoint(mouse_pos) != root)
break;
if(event.MouseInput.Wheel < 0) {
if(mainGame->scrFilter->getPos() < mainGame->scrFilter->getMax())
mainGame->scrFilter->setPos(mainGame->scrFilter->getPos() + 1);
......
......@@ -1765,6 +1765,10 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
case irr::gui::EGET_SCROLL_BAR_CHANGED: {
switch(id) {
case SCROLL_CARDTEXT: {
if(!mainGame->scrCardText->isVisible()) {
return true;
break;
}
u32 pos = mainGame->scrCardText->getPos();
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 25, mainGame->textFont, mainGame->showingtext, pos);
return true;
......
......@@ -754,6 +754,8 @@ void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cH
SetStaticText(pControl, cWidth, font, text);
if(font->getDimension(dataManager.strBuffer).Height <= cHeight) {
scrCardText->setVisible(false);
if(env->hasFocus(scrCardText))
env->removeFocus(scrCardText);
return;
}
SetStaticText(pControl, cWidth-25, font, text);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment