void Page::free( const FragmentSharedPtr& pFragment )
{ // the fragment passes as argument is no longer // dedicated to this page. either it is about to // be relocated to some other page or it will // currently be deleted. in either case, simply // remove the reference from our internal storage.
std::erase(mpFragments, pFragment);
}
bool Page::insert( SurfaceRect& r )
{ for( constauto& pFragment : mpFragments )
{ const SurfaceRect &rect = pFragment->getRect(); const sal_Int32 x = rect.maPos.getX(); const sal_Int32 y = rect.maPos.getY(); // to avoid interpolation artifacts from other textures, // one pixel gap between them const sal_Int32 w = rect.maSize.getWidth() + 1; const sal_Int32 h = rect.maSize.getHeight() + 1;
// probe location to the right
r.maPos.setX(x+w);
r.maPos.setY(y); if(isValidLocation(r)) returntrue;
// probe location at bottom
r.maPos.setX(x);
r.maPos.setY(y+h); if(isValidLocation(r)) returntrue;
}
r.maPos.setX(0);
r.maPos.setY(0);
return isValidLocation(r);
}
bool Page::isValidLocation( const SurfaceRect& r ) const
{ // the rectangle passed as argument has a valid // location if and only if there's no intersection // with existing areas.
basegfx::B2ISize aSize(mpRenderModule->getPageSize().getX(), mpRenderModule->getPageSize().getY());
SurfaceRect aBoundary(aSize); if( !r.inside(aBoundary) ) returnfalse;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.