mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Merge pull request #4380 from SoundSSGood/moveChildForeground
Fixed graphical artifacts
This commit is contained in:
commit
97357071b0
@ -258,6 +258,15 @@ void CIntObject::redraw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CIntObject::moveChildForeground(const CIntObject * childToMove)
|
||||||
|
{
|
||||||
|
for(auto child = children.begin(); child != children.end(); child++)
|
||||||
|
if(*child == childToMove && child != children.end())
|
||||||
|
{
|
||||||
|
std::rotate(child, child + 1, children.end());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CIntObject::receiveEvent(const Point & position, int eventType) const
|
bool CIntObject::receiveEvent(const Point & position, int eventType) const
|
||||||
{
|
{
|
||||||
return pos.isInside(position);
|
return pos.isInside(position);
|
||||||
|
@ -102,6 +102,8 @@ public:
|
|||||||
void showAll(Canvas & to) override;
|
void showAll(Canvas & to) override;
|
||||||
//request complete redraw of this object
|
//request complete redraw of this object
|
||||||
void redraw() override;
|
void redraw() override;
|
||||||
|
// Move child object to foreground
|
||||||
|
void moveChildForeground(const CIntObject * childToMove);
|
||||||
|
|
||||||
/// returns true if this element is a popup window
|
/// returns true if this element is a popup window
|
||||||
/// called only for windows
|
/// called only for windows
|
||||||
|
@ -90,6 +90,7 @@ CArtPlace::CArtPlace(Point position, const CArtifactInstance * art)
|
|||||||
|
|
||||||
image = std::make_shared<CAnimImage>(AnimationPath::builtin("artifact"), imageIndex);
|
image = std::make_shared<CAnimImage>(AnimationPath::builtin("artifact"), imageIndex);
|
||||||
image->disable();
|
image->disable();
|
||||||
|
moveSelectionForeground();
|
||||||
}
|
}
|
||||||
|
|
||||||
const CArtifactInstance * CArtPlace::getArt() const
|
const CArtifactInstance * CArtPlace::getArt() const
|
||||||
|
@ -714,3 +714,8 @@ void SelectableSlot::setSelectionWidth(int width)
|
|||||||
selection = std::make_shared<TransparentFilledRectangle>( selection->pos - pos.topLeft(), Colors::TRANSPARENCY, Colors::YELLOW, width);
|
selection = std::make_shared<TransparentFilledRectangle>( selection->pos - pos.topLeft(), Colors::TRANSPARENCY, Colors::YELLOW, width);
|
||||||
selectSlot(selected);
|
selectSlot(selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SelectableSlot::moveSelectionForeground()
|
||||||
|
{
|
||||||
|
moveChildForeground(selection.get());
|
||||||
|
}
|
||||||
|
@ -261,4 +261,5 @@ public:
|
|||||||
void selectSlot(bool on);
|
void selectSlot(bool on);
|
||||||
bool isSelected() const;
|
bool isSelected() const;
|
||||||
void setSelectionWidth(int width);
|
void setSelectionWidth(int width);
|
||||||
|
void moveSelectionForeground();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user