MCPcopy Index your code
hub / github.com/microsoft/SandDance / initializeResize

Function initializeResize

docs/app/js/sanddance-app.js:142302–142327  ·  view source on GitHub ↗
(view)

Source from the content-addressed store, hash-verified

142300 return height1 - (a && a.contains === Padding ? p.top + p.bottom : 0);
142301}
142302function initializeResize(view) {
142303 var s = view._signals, w = s[Width], h = s[Height], p = s[Padding];
142304 function resetSize() {
142305 view._autosize = view._resize = 1;
142306 } // respond to width signal
142307 view._resizeWidth = view.add(null, (_)=>{
142308 view._width = _.size;
142309 view._viewWidth = viewWidth(view, _.size);
142310 resetSize();
142311 }, {
142312 size: w
142313 }); // respond to height signal
142314 view._resizeHeight = view.add(null, (_)=>{
142315 view._height = _.size;
142316 view._viewHeight = viewHeight(view, _.size);
142317 resetSize();
142318 }, {
142319 size: h
142320 }); // respond to padding signal
142321 const resizePadding = view.add(null, resetSize, {
142322 pad: p
142323 }); // set rank to run immediately after source signal
142324 view._resizeWidth.rank = w.rank + 1;
142325 view._resizeHeight.rank = h.rank + 1;
142326 resizePadding.rank = p.rank + 1;
142327}
142328function resizeView(viewWidth1, viewHeight1, width2, height2, origin, auto) {
142329 this.runAfter((view)=>{
142330 let rerun = 0; // reset autosize flag

Callers 1

ViewFunction · 0.70

Calls 4

viewWidthFunction · 0.70
resetSizeFunction · 0.70
viewHeightFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected