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

Method stringInterfaceWidth

source/windowing/StarGuiContext.cpp:407–414  ·  view source on GitHub ↗

TODO: Make this use StringView

Source from the content-addressed store, hash-verified

405
406//TODO: Make this use StringView
407int GuiContext::stringInterfaceWidth(String const& s) {
408 if (interfaceScale()) {
409 // font size is already adjusted UP by interfaceScale, so we have to adjust
410 // it back down
411 return stringWidth(s) / interfaceScale();
412 }
413 return 0;
414}
415
416StringList GuiContext::wrapText(String const& s, Maybe<unsigned> wrapWidth) {
417 return textPainter()->wrapText(s, wrapWidth);

Callers 1

newTextValidMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected