MCPcopy Create free account
hub / github.com/ddnet/ddnet / UpdateClipping

Method UpdateClipping

src/game/client/ui.cpp:495–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495void CUi::UpdateClipping()
496{
497 if(IsClipped())
498 {
499 const CUIRect *pRect = ClipArea();
500 const float XScale = Graphics()->ScreenWidth() / Screen()->w;
501 const float YScale = Graphics()->ScreenHeight() / Screen()->h;
502 Graphics()->ClipEnable((int)(pRect->x * XScale), (int)(pRect->y * YScale), (int)(pRect->w * XScale), (int)(pRect->h * YScale));
503 }
504 else
505 {
506 Graphics()->ClipDisable();
507 }
508}
509
510int CUi::DoButtonLogic(const void *pId, int Checked, const CUIRect *pRect, const unsigned Flags)
511{

Callers

nothing calls this directly

Calls 5

GraphicsFunction · 0.85
ScreenWidthMethod · 0.80
ScreenHeightMethod · 0.80
ClipEnableMethod · 0.45
ClipDisableMethod · 0.45

Tested by

no test coverage detected