MCPcopy Create free account
hub / github.com/TankOs/SFGUI / HandleRequisitionChange

Method HandleRequisitionChange

src/SFGUI/Viewport.cpp:200–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void Viewport::HandleRequisitionChange() {
201 // A child just requested it's size. Because we are a viewport
202 // and have a virtual screen we give it everything it wants.
203 if( GetChild() ) {
204 auto new_allocation = GetChild()->GetAllocation();
205 new_allocation.size.x = GetChild()->GetRequisition().x;
206 new_allocation.size.y = GetChild()->GetRequisition().y;
207 GetChild()->SetAllocation( new_allocation );
208 }
209}
210
211const std::string& Viewport::GetName() const {
212 static const std::string name( "Viewport" );

Callers

nothing calls this directly

Calls 1

SetAllocationMethod · 0.80

Tested by

no test coverage detected