MCPcopy Create free account
hub / github.com/Snapchat/Valdi / drawTextDecorations

Method drawTextDecorations

snap_drawing/src/snap_drawing/cpp/Layers/TextLayer.cpp:93–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 auto& layout = getTextLayout(layerSize, *getResources());
92 auto offsetY = getTextVerticalOffset(layerSize, layout, displayScale);
93 drawingContext.concat(Matrix::makeScaleTranslate(1.0f / displayScale, 1.0f / displayScale, 0.0f, offsetY));
94
95 if (hasTextShadow()) {
96 // Draw all of the shadows first
97 drawTextVisualEntriesShadows(drawingContext, layout.getVisualEntries());
98 for (const auto& entry : layout.getEntries()) {
99 if (entry.textBlob != nullptr) {
100 drawTextShadows(drawingContext, entry.textBlob);
101 }
102 }
103 }
104
105 // Then draw all of the text things
106 drawTextVisualEntries(drawingContext, layout.getVisualEntries(), /* predraw */ true);
107
108 for (const auto& entry : layout.getEntries()) {
109 if (entry.textBlob != nullptr) {
110 drawText(drawingContext, entry.textBlob, entry.color);
111 }
112 }
113
114 drawTextVisualEntries(drawingContext, layout.getVisualEntries(), /* predraw */ false);

Callers

nothing calls this directly

Calls 4

hasGradientMethod · 0.80
drawPaintMethod · 0.80
valueMethod · 0.65
setColorMethod · 0.45

Tested by

no test coverage detected