Skip to content

Commit

Permalink
Add module background panel resizing function
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed Dec 24, 2015
1 parent fdfc096 commit f2cfc5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions javascript/cs.2click.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ function buildslots()

this.patcher.bringtofront(twoclickObjects[4*k+3]);
}
resizepanel();
}

// resizepanel -- fits background panel to number of slots
function resizepanel()
{
backpanelName = uiid + "-module-backpanel";
backpanel = this.patcher.getnamed(backpanelName);
if (backpanel) {
backpanel.message("presentation_size",120,slotnum*15);
}
}

// addclearbutton -- add a clear slot button to a given slot number & type
Expand Down
3 changes: 2 additions & 1 deletion patchers/cs.2click-inputs.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -10609,7 +10609,8 @@
"patching_rect" : [ 0.0, 15.0, 120.0, 120.0 ],
"presentation" : 1,
"presentation_rect" : [ 0.0, 15.0, 120.0, 120.0 ],
"rounded" : 0
"rounded" : 0,
"varname" : "#0-module-backpanel"
}

}
Expand Down
3 changes: 2 additions & 1 deletion patchers/cs.2click-outputs.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -10749,7 +10749,8 @@
"patching_rect" : [ 0.0, 15.0, 120.0, 120.0 ],
"presentation" : 1,
"presentation_rect" : [ 0.0, 15.0, 120.0, 120.0 ],
"rounded" : 0
"rounded" : 0,
"varname" : "#0-module-backpanel"
}

}
Expand Down

0 comments on commit f2cfc5f

Please sign in to comment.