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

Method drawDrawable

source/windowing/StarGuiContext.cpp:167–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void GuiContext::drawDrawable(Drawable drawable, Vec2F const& screenPos, float pixelRatio, Vec4B const& color) {
168 if (drawable.isLine())
169 drawable.linePart().width *= pixelRatio;
170
171 drawable.scale(pixelRatio);
172 drawable.translate(screenPos);
173 drawable.color *= Color::rgba(color);
174 m_drawablePainter->drawDrawable(drawable);
175}
176
177void GuiContext::drawLine(Vec2F const& begin, Vec2F const end, Vec4B const& color, float lineWidth) {
178 Vec2F left = vnorm(Vec2F(end) - Vec2F(begin)).rot90() * lineWidth / 2.0f;

Callers 2

makeMethod · 0.45
renderImplMethod · 0.45

Calls 3

isLineMethod · 0.80
scaleMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected