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

Function makeViewFrame

valdi/src/valdi/snap_drawing/SnapDrawingViewTransaction.cpp:102–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102static Rect makeViewFrame(const Valdi::Frame& frame, Scalar displayScale) {
103 auto x = Valdi::roundToPixelGrid(frame.x, displayScale);
104 auto y = Valdi::roundToPixelGrid(frame.y, displayScale);
105 auto width = Valdi::roundToPixelGrid(frame.width, displayScale);
106 auto height = Valdi::roundToPixelGrid(frame.height, displayScale);
107
108 return Rect::makeXYWH(x, y, width, height);
109}
110
111void SnapDrawingViewTransaction::setViewFrame(const Ref<View>& view,
112 const Frame& newFrame,

Callers 1

setViewFrameMethod · 0.85

Calls 1

roundToPixelGridFunction · 0.85

Tested by

no test coverage detected