fixed ration binding
This commit is contained in:
@@ -126,8 +126,6 @@ let app = {
|
|||||||
this.finishedH = false;
|
this.finishedH = false;
|
||||||
this.finishedV = false;
|
this.finishedV = false;
|
||||||
this.incomplete = false;
|
this.incomplete = false;
|
||||||
this.fbw = false;
|
|
||||||
this.fbh = false;
|
|
||||||
['sw', 'sh', 'm', 'n', 'bw', 'bh', 'rw', 'rh', 'mh', 'mv', 'ph', 'pv'].forEach(name => {
|
['sw', 'sh', 'm', 'n', 'bw', 'bh', 'rw', 'rh', 'mh', 'mv', 'ph', 'pv'].forEach(name => {
|
||||||
if (self[name]) {
|
if (self[name]) {
|
||||||
Vue.set(self, name, parseFloat(self[name]));
|
Vue.set(self, name, parseFloat(self[name]));
|
||||||
@@ -137,14 +135,26 @@ let app = {
|
|||||||
this.incomplete = true;
|
this.incomplete = true;
|
||||||
} else {
|
} else {
|
||||||
if (this.ratio && this.rw && this.rh) {
|
if (this.ratio && this.rw && this.rh) {
|
||||||
if (this.bh && !this.fbw) {
|
if (!this.fbw && !this.fbh) {
|
||||||
|
if (this.bh) {
|
||||||
this.fbw = true;
|
this.fbw = true;
|
||||||
this.bw = utils.round(this.bh * this.rw / this.rh, 2);
|
this.bw = utils.round(this.bh * this.rw / this.rh, 2);
|
||||||
}
|
} else if (this.bw) {
|
||||||
if (this.bw && !this.fbh) {
|
|
||||||
this.fbh = true;
|
this.fbh = true;
|
||||||
this.bh = utils.round(this.bw * this.rh / this.rw, 2);
|
this.bh = utils.round(this.bw * this.rh / this.rw, 2);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (this.fbw && !this.bh) {
|
||||||
|
this.fbw = false;
|
||||||
|
this.bw = undefined;
|
||||||
|
} else if (this.fbh && !this.bw) {
|
||||||
|
this.fbh = false;
|
||||||
|
this.bh = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.fbw = false;
|
||||||
|
this.fbh = false;
|
||||||
}
|
}
|
||||||
if (this.padding) {
|
if (this.padding) {
|
||||||
const uh = !this.bw + !this.mh + !this.ph;
|
const uh = !this.bw + !this.mh + !this.ph;
|
||||||
|
|||||||
Reference in New Issue
Block a user