Refine snapshot invalidation and modal resize behavior
This commit is contained in:
+13
-5
@@ -58,7 +58,7 @@ void Control::setIsVisible(bool show)
|
||||
if (!show)
|
||||
{
|
||||
// 隐藏:擦除自己在屏幕上的内容,并释放快照
|
||||
this->updateBackground();
|
||||
discardBackground();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void Control::onWindowResize()
|
||||
<< SX_T(" -> 丢背景快照 + 标脏", " -> discardSnap + dirty");
|
||||
|
||||
// 自己:丢快照 + 标脏
|
||||
discardBackground();
|
||||
invalidateBackgroundSnapshot();
|
||||
setDirty(true);
|
||||
}
|
||||
void Control::setLayoutMode(StellarX::LayoutMode layoutMode_)
|
||||
@@ -200,8 +200,16 @@ void Control::discardBackground()
|
||||
hasSnap = false; saveWidth = saveHeight = 0;
|
||||
}
|
||||
|
||||
void Control::updateBackground()
|
||||
void Control::invalidateBackgroundSnapshot()
|
||||
{
|
||||
restBackground();
|
||||
discardBackground();
|
||||
if (saveBkImage)
|
||||
{
|
||||
SX_LOGD("Snap") << SX_T("作废背景快照:id=", "invalidateBackgroundSnapshot: id=") << id
|
||||
<< " hasSnap=" << (hasSnap ? 1 : 0);
|
||||
saveBkImage.reset();
|
||||
}
|
||||
hasSnap = false;
|
||||
saveBkX = saveBkY = 0;
|
||||
saveWidth = saveHeight = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user