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

Method SetCompositionWindowPosition

src/game/client/lineinput.cpp:629–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627}
628
629void CLineInput::SetCompositionWindowPosition(vec2 Anchor, float LineHeight)
630{
631 float ScreenX0, ScreenY0, ScreenX1, ScreenY1;
632 const int ScreenWidth = Graphics()->ScreenWidth();
633 const int ScreenHeight = Graphics()->ScreenHeight();
634 Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1);
635
636 const vec2 ScreenScale = vec2(ScreenWidth / (ScreenX1 - ScreenX0), ScreenHeight / (ScreenY1 - ScreenY0));
637 ms_CompositionWindowPosition = Anchor * ScreenScale;
638 ms_CompositionLineHeight = LineHeight * ScreenScale.y;
639 Input()->SetCompositionWindowPosition(ms_CompositionWindowPosition.x, ms_CompositionWindowPosition.y, ms_CompositionLineHeight);
640}
641
642void CLineInput::Activate(EInputPriority Priority)
643{

Callers

nothing calls this directly

Calls 5

GraphicsFunction · 0.85
InputFunction · 0.85
ScreenWidthMethod · 0.80
ScreenHeightMethod · 0.80
GetScreenMethod · 0.80

Tested by

no test coverage detected