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

Method renderLine

source/windowing/StarCanvasWidget.cpp:227–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void CanvasWidget::renderLine(Vec2F const& renderingOffset, Vec2F const& begin, Vec2F const end, Vec4B const& color, float lineWidth) {
228 auto& context = GuiContext::singleton();
229 if (m_ignoreInterfaceScale)
230 context.drawLine(renderingOffset + begin, renderingOffset + end, color, lineWidth);
231 else {
232 context.drawLine(
233 renderingOffset * context.interfaceScale() + begin * context.interfaceScale(),
234 renderingOffset * context.interfaceScale() + end * context.interfaceScale(),
235 color, lineWidth);
236 }
237}
238
239void CanvasWidget::renderRect(Vec2F const& renderingOffset, RectF const& coords, Vec4B const& color) {
240 auto& context = GuiContext::singleton();

Callers

nothing calls this directly

Calls 3

singletonClass · 0.85
drawLineMethod · 0.45
interfaceScaleMethod · 0.45

Tested by

no test coverage detected