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

Function roundToPixelGrid

valdi/src/valdi/runtime/Views/Measure.cpp:23–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23float roundToPixelGrid(float point, float pointScale) {
24 return roundf(point * pointScale) / pointScale;
25}
26
27float sanitizeMeasurement(float constrainedSize, float measuredSize, float pointScale, MeasureMode measureMode) {
28 measuredSize = ceilf(measuredSize * pointScale) / pointScale;

Callers 8

TESTFunction · 0.85
applyCircularScrollFunction · 0.85
roundToPixelGridMethod · 0.85
parseYGStyleLengthMethod · 0.85
valueToYGStyleLengthMethod · 0.85
makeViewFrameFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68