Paint order fix

This commit is contained in:
Bertrand Songis
2020-09-25 21:29:16 +02:00
parent ce74048a51
commit e124360484
+13 -11
View File
@@ -226,27 +226,29 @@ bool Window::hasOpaqueRect(const rect_t & testRect) const
void Window::fullPaint(BitmapBuffer * dc)
{
bool paintNeeded = true;
std::list<Window *>::iterator firstChild;
coord_t xmin, xmax, ymin, ymax;
dc->getClippingRect(xmin, xmax, ymin, ymax);
coord_t x = dc->getOffsetX();
coord_t y = dc->getOffsetY();
auto firstChild = children.end();
rect_t relativeRect = {xmin - x, ymin - y, xmax - xmin, ymax - ymin};
while (firstChild != children.begin()) {
auto child = *(--firstChild);
if (child->hasOpaqueRect(relativeRect)) {
paintNeeded = false;
break;
}
}
if (windowFlags & PAINT_CHILDREN_FIRST) {
paintChildren(dc, firstChild);
paintChildren(dc, children.begin());
dc->setOffset(x, y);
dc->setClippingRect(xmin, xmax, ymin, ymax);
}
else {
firstChild = children.end();
rect_t relativeRect = {xmin - x, ymin - y, xmax - xmin, ymax - ymin};
while (firstChild != children.begin()) {
auto child = *(--firstChild);
if (child->hasOpaqueRect(relativeRect)) {
paintNeeded = false;
break;
}
}
}
if (paintNeeded) {
TRACE_WINDOWS_INDENT("%s%s", getWindowDebugString().c_str(), hasFocus() ? " (*)" : "");