1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

try to fix

This commit is contained in:
Laserlicht 2023-10-21 23:37:59 +02:00 committed by GitHub
parent f3acc939b9
commit 6939989026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View File

@ -258,6 +258,16 @@ void CIntObject::redraw()
}
}
void CIntObject::clickPressed(const Point & cursorPosition, bool lastActivated)
{
AEventsReceiver::clickPressed(cursorPosition);
}
void CIntObject::clickReleased(const Point & cursorPosition, bool lastActivated)
{
AEventsReceiver::clickReleased(cursorPosition);
}
bool CIntObject::receiveEvent(const Point & position, int eventType) const
{
return pos.isInside(position);

View File

@ -99,6 +99,10 @@ public:
//request complete redraw of this object
void redraw() override;
// events are overloaded
void clickPressed(const Point & cursorPosition, bool lastActivated) override;
void clickReleased(const Point & cursorPosition, bool lastActivated) override;
/// returns true if this element is a popup window
/// called only for windows
bool isPopupWindow() const override;

View File

@ -213,16 +213,10 @@ void EventDispatcher::handleLeftButtonClick(const Point & position, int toleranc
if( i->receiveEvent(position, AEventsReceiver::LCLICK) || i == nearestElement)
{
if(isPressed)
{
i->clickPressed(position);
i->clickPressed(position, lastActivated);
}
i->clickReleased(position, lastActivated);
if (i->mouseClickedState && !isPressed)
{
i->clickReleased(position);
i->clickReleased(position, lastActivated);
}
i->mouseClickedState = isPressed;
lastActivated = false;