* update the visible status of new children
* speed up from/to screen conversion of BRects and BRegions * invisible views don't need updating git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16257 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4167cbe823
commit
6134fcc936
@ -175,6 +175,8 @@ ViewLayer::AddChild(ViewLayer* layer)
|
|||||||
}
|
}
|
||||||
fLastChild = layer;
|
fLastChild = layer;
|
||||||
|
|
||||||
|
layer->UpdateVisibleDeep(fVisible);
|
||||||
|
|
||||||
if (layer->IsVisible())
|
if (layer->IsVisible())
|
||||||
RebuildClipping(false);
|
RebuildClipping(false);
|
||||||
|
|
||||||
@ -484,21 +486,21 @@ ViewLayer::ConvertToScreen(BPoint* pt) const
|
|||||||
void
|
void
|
||||||
ViewLayer::ConvertToScreen(BRect* rect) const
|
ViewLayer::ConvertToScreen(BRect* rect) const
|
||||||
{
|
{
|
||||||
ConvertToParent(rect);
|
BPoint offset(0.0, 0.0);
|
||||||
|
ConvertToScreen(&offset);
|
||||||
|
|
||||||
if (fParent)
|
rect->OffsetBy(offset);
|
||||||
fParent->ConvertToScreen(rect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! converts a region from local to screen coordinate system
|
//! converts a region from local to screen coordinate system
|
||||||
void
|
void
|
||||||
ViewLayer::ConvertToScreen(BRegion* reg) const
|
ViewLayer::ConvertToScreen(BRegion* region) const
|
||||||
{
|
{
|
||||||
ConvertToParent(reg);
|
BPoint offset(0.0, 0.0);
|
||||||
|
ConvertToScreen(&offset);
|
||||||
|
|
||||||
if (fParent)
|
region->OffsetBy(offset.x, offset.y);
|
||||||
fParent->ConvertToScreen(reg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -517,21 +519,21 @@ ViewLayer::ConvertFromScreen(BPoint* pt) const
|
|||||||
void
|
void
|
||||||
ViewLayer::ConvertFromScreen(BRect* rect) const
|
ViewLayer::ConvertFromScreen(BRect* rect) const
|
||||||
{
|
{
|
||||||
ConvertFromParent(rect);
|
BPoint offset(0.0, 0.0);
|
||||||
|
ConvertFromScreen(&offset);
|
||||||
|
|
||||||
if (fParent)
|
rect->OffsetBy(offset.x, offset.y);
|
||||||
fParent->ConvertFromScreen(rect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! converts a region from screen to local coordinate system
|
//! converts a region from screen to local coordinate system
|
||||||
void
|
void
|
||||||
ViewLayer::ConvertFromScreen(BRegion* reg) const
|
ViewLayer::ConvertFromScreen(BRegion* region) const
|
||||||
{
|
{
|
||||||
ConvertFromParent(reg);
|
BPoint offset(0.0, 0.0);
|
||||||
|
ConvertFromScreen(&offset);
|
||||||
|
|
||||||
if (fParent)
|
region->OffsetBy(offset.x, offset.y);
|
||||||
fParent->ConvertFromScreen(reg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1020,6 +1022,9 @@ ViewLayer::AddTokensForLayersInRegion(BMessage* message,
|
|||||||
BRegion& region,
|
BRegion& region,
|
||||||
BRegion* windowContentClipping)
|
BRegion* windowContentClipping)
|
||||||
{
|
{
|
||||||
|
if (!fVisible)
|
||||||
|
return;
|
||||||
|
|
||||||
if (region.Intersects(ScreenClipping(windowContentClipping).Frame()))
|
if (region.Intersects(ScreenClipping(windowContentClipping).Frame()))
|
||||||
message->AddInt32("_token", fToken);
|
message->AddInt32("_token", fToken);
|
||||||
|
|
||||||
@ -1034,6 +1039,9 @@ ViewLayer::AddTokensForLayersInRegion(BPrivate::PortLink& link,
|
|||||||
BRegion& region,
|
BRegion& region,
|
||||||
BRegion* windowContentClipping)
|
BRegion* windowContentClipping)
|
||||||
{
|
{
|
||||||
|
if (!fVisible)
|
||||||
|
return;
|
||||||
|
|
||||||
if (region.Intersects(ScreenClipping(windowContentClipping).Frame()))
|
if (region.Intersects(ScreenClipping(windowContentClipping).Frame()))
|
||||||
link.Attach<int32>(fToken);
|
link.Attach<int32>(fToken);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user