Example #1
0
void ContentContainer::DrawContentsInRegions(const Regions& rgns, const Point& offset) const
{
	// layout shouldn't be empty unless there is no content anyway...
	if (layout.empty()) return;

	// should only have 1 region
	const Region& rgn = rgns.front();

	// TODO: intersect with the screen clip so we can bail out even earlier

	const Point& drawOrigin = rgn.Origin();
	Point drawPoint = drawOrigin;
	ContentLayout::const_iterator it = layout.begin();

#if (DEBUG_TEXT)
	Region dr(parentOffset + offset, contentBounds);
	core->GetVideoDriver()->DrawRect(dr, ColorRed, true);
	core->GetVideoDriver()->DrawRect(dr, ColorWhite, false);
	dr = Region(parentOffset + offset, ContentFrame());
	core->GetVideoDriver()->DrawRect(dr, ColorGreen, true);
	core->GetVideoDriver()->DrawRect(dr, ColorWhite, false);
#endif

	for (; it != layout.end(); ++it) {
		const Layout& l = *it;
		assert(drawPoint.x <= drawOrigin.x + frame.w);
		l.content->DrawContentsInRegions(l.regions, offset + parentOffset);
	}
}
Example #2
0
void ImageSpan::DrawContentsInRegions(const Regions& rgns, const Point& offset) const
{
	// we only care about the first region... (should only be 1 anyway)
	Region r = rgns.front();
	r.x += offset.x;
	r.y += offset.y;
	core->GetVideoDriver()->BlitSprite(image, r.x, r.y, true, &r);
}