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:
parent
f3acc939b9
commit
6939989026
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user