Skip to content

Commit

Permalink
🧰: prevent padding control from bombing performance
Browse files Browse the repository at this point in the history
  • Loading branch information
merryman authored and linusha committed Mar 5, 2024
1 parent eca0339 commit 4c34006
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lively.ide/studio/controls/popups.cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,20 @@ export class PaddingControlsModel extends ViewModel {
}

startPadding (pad) {
const left = pad.left();
const right = pad.right();
const bottom = pad.bottom();
const top = pad.top();
this.showAllSidesControl = !(arr.uniq([left, right, top, bottom]).length === 1);
this.ui.paddingBottom.number = bottom;
this.ui.paddingLeft.number = left;
this.ui.paddingRight.number = right;
this.ui.paddingTop.number = top;
this.withoutBindingsDo(() => {
const left = pad.left();
const right = pad.right();
const bottom = pad.bottom();
const top = pad.top();
this.showAllSidesControl = !(arr.uniq([left, right, top, bottom]).length === 1);
this.ui.paddingBottom.number = bottom;
this.ui.paddingLeft.number = left;
this.ui.paddingRight.number = right;
this.ui.paddingTop.number = top;

if (!this.showAllSidesControl) this.ui.paddingAll.number = left;
else this.ui.paddingAll.setMixed();
if (!this.showAllSidesControl) this.ui.paddingAll.number = left;
else this.ui.paddingAll.setMixed();
});
}

viewDidLoad () {
Expand Down

0 comments on commit 4c34006

Please sign in to comment.