MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / AlignNode

Method AlignNode

Source/Node/AlignNode.cpp:250–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250AlignNode::AlignNode(bool isWindowRoot) {
251 if (isWindowRoot) {
252 setSize(SharedApplication.getVisualSize());
253 float scale = SharedApplication.getDevicePixelRatio();
254 setScaleX(scale);
255 setScaleY(scale);
256 gslot("AppChange"_slice, [this](Event* e) {
257 std::string settingName;
258 if (!e->get(settingName)) return;
259 if (settingName != "Size"sv) return;
260 setSize(SharedApplication.getVisualSize());
261 float scale = SharedApplication.getDevicePixelRatio();
262 setScaleX(scale);
263 setScaleY(scale);
264 YGNodeStyleSetWidth(_yogaNode, getWidth());
265 YGNodeStyleSetHeight(_yogaNode, getHeight());
266 YGNodeCalculateLayout(_yogaNode, YGUndefined, YGUndefined, YGDirectionLTR);
267 alignLayout();
268 });
269 }
270}
271
272bool AlignNode::init() {
273 if (!Node::init()) return false;

Callers 1

DoraX.tsFile · 0.45

Calls 7

setSizeFunction · 0.85
YGNodeStyleSetWidthFunction · 0.85
YGNodeStyleSetHeightFunction · 0.85
YGNodeCalculateLayoutFunction · 0.85
getVisualSizeMethod · 0.80
getDevicePixelRatioMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected