MCPcopy Create free account
hub / github.com/ZDoom/Raze / begin

Method begin

libraries/ZWidget/src/core/canvas.cpp:663–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663void BitmapCanvas::begin(const Colorf& color)
664{
665 uiscale = window->GetDpiScale();
666
667 uint32_t r = (int32_t)clamp(color.r * 255.0f, 0.0f, 255.0f);
668 uint32_t g = (int32_t)clamp(color.g * 255.0f, 0.0f, 255.0f);
669 uint32_t b = (int32_t)clamp(color.b * 255.0f, 0.0f, 255.0f);
670 uint32_t a = (int32_t)clamp(color.a * 255.0f, 0.0f, 255.0f);
671 uint32_t bgcolor = (a << 24) | (r << 16) | (g << 8) | b;
672 width = window->GetPixelWidth();
673 height = window->GetPixelHeight();
674 pixels.clear();
675 pixels.resize(width * height, bgcolor);
676}
677
678void BitmapCanvas::end()
679{

Callers 9

Win32WindowMethod · 0.45
FindTextBlocksMethod · 0.45
PlaceLineSegmentsMethod · 0.45
RepaintMethod · 0.45
GetGlyphIndexMethod · 0.45
OnKeyDownMethod · 0.45
GetTotalLineHeightMethod · 0.45
InsertTextMethod · 0.45
OnKeyDownMethod · 0.45

Calls 6

clampFunction · 0.85
GetDpiScaleMethod · 0.45
GetPixelWidthMethod · 0.45
GetPixelHeightMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected