MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / renderCursor

Method renderCursor

source/frontend/StarErrorScreen.cpp:60–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void ErrorScreen::renderCursor() {
61 Vec2I cursorPos = m_cursorScreenPos;
62 Vec2I cursorSize = m_cursor.size();
63 Vec2I cursorOffset = m_cursor.offset();
64 unsigned int cursorScale = m_cursor.scale(interfaceScale());
65 Drawable cursorDrawable = m_cursor.drawable();
66
67 cursorPos[0] -= cursorOffset[0] * cursorScale;
68 cursorPos[1] -= (cursorSize[1] - cursorOffset[1]) * cursorScale;
69 if (!m_guiContext->trySetCursor(cursorDrawable, cursorOffset, cursorScale))
70 m_guiContext->drawDrawable(cursorDrawable, Vec2F(cursorPos), cursorScale);
71}
72
73float ErrorScreen::interfaceScale() const {
74 return m_guiContext->interfaceScale();

Callers

nothing calls this directly

Calls 6

trySetCursorMethod · 0.80
sizeMethod · 0.45
offsetMethod · 0.45
scaleMethod · 0.45
drawableMethod · 0.45
drawDrawableMethod · 0.45

Tested by

no test coverage detected