MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / invalidateDisplayRegion

Method invalidateDisplayRegion

src/ui/manager.cpp:1359–1391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1357}
1358
1359void Manager::invalidateDisplayRegion(const gfx::Region& region)
1360{
1361 // TODO intersect with getDrawableRegion()???
1362 gfx::Region reg1;
1363 reg1.createIntersection(region, gfx::Region(bounds()));
1364
1365 // Redraw windows from top to background.
1366 bool withDesktop = false;
1367 for (auto child : children()) {
1368 ASSERT(dynamic_cast<Window*>(child));
1369 ASSERT(child->type() == kWindowWidget);
1370 Window* window = static_cast<Window*>(child);
1371
1372 // Invalidate regions of this window
1373 window->invalidateRegion(reg1);
1374
1375 // There is desktop?
1376 if (window->isDesktop()) {
1377 withDesktop = true;
1378 break; // Work done
1379 }
1380
1381 // Clip this window area for the next window.
1382 gfx::Region reg3;
1383 window->getRegion(reg3);
1384 reg1.createSubtraction(reg1, reg3);
1385 }
1386
1387 // Invalidate areas outside windows (only when there are not a
1388 // desktop window).
1389 if (!withDesktop)
1390 Widget::invalidateRegion(reg1);
1391}
1392
1393LayoutIO* Manager::getLayoutIO()
1394{

Callers 1

moveWindowMethod · 0.80

Calls 6

isDesktopMethod · 0.80
getRegionMethod · 0.80
RegionClass · 0.70
createIntersectionMethod · 0.45
typeMethod · 0.45
invalidateRegionMethod · 0.45

Tested by

no test coverage detected