Skip to content

Commit

Permalink
fix calculate multiple range bug
Browse files Browse the repository at this point in the history
  • Loading branch information
moshuying committed Jun 26, 2023
1 parent 53f4200 commit 8e89d2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editor/inspector/components/lod-group/multi-lod-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exports.watch = {
},
};

exports.data = function() {
exports.data = function () {
return {
multiLen: 0,
multiObjectSizeInvalid: false,
Expand Down Expand Up @@ -121,7 +121,7 @@ exports.methods = {
let min = that.dump.value.LODs.values[0][index + 1] ? that.dump.value.LODs.values[0][index + 1].value.screenUsagePercentage.value : 0;
for (let i = 1; i < that.dump.value.LODs.values.length; i++) {
const multiLods = that.dump.value.LODs.values[i];
if (multiLods[index + 1] && multiLods[index + 1].value.screenUsagePercentage.value > min) {
if (multiLods[index + 1] && multiLods[index + 1].value.screenUsagePercentage.value < min) {
min = multiLods[index + 1].value.screenUsagePercentage.value;
}
}
Expand All @@ -131,7 +131,7 @@ exports.methods = {
if (max) {
for (let i = 1; i < that.dump.value.LODs.values.length; i++) {
const multiLods = that.dump.value.LODs.values[i];
if (multiLods[index - 1] && multiLods[index - 1].value.screenUsagePercentage.value < max) {
if (multiLods[index - 1] && multiLods[index - 1].value.screenUsagePercentage.value > max) {
max = multiLods[index - 1].value.screenUsagePercentage.value;
}
}
Expand Down

0 comments on commit 8e89d2e

Please sign in to comment.