openatc-components 0.3.95 → 0.3.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1268,16 +1268,17 @@ export default {
1268
1268
  obj.split = split
1269
1269
  obj.cycle = cycle
1270
1270
  const isZero = split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen
1271
+ const allAdd = split + currPhase.redclear + currPhase.yellow + currPhase.flashgreen
1271
1272
  if (isZero <= 0) {
1272
1273
  if (ring.sum) {
1273
1274
  obj.sum = ring.sum
1274
- obj.redWidth = ((((currPhase.redclear + ring.sum) / split) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1275
+ obj.redWidth = ((((currPhase.redclear + ring.sum) / allAdd) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1275
1276
  } else {
1276
- obj.redWidth = (((currPhase.redclear / split) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1277
+ obj.redWidth = (((currPhase.redclear / allAdd) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1277
1278
  }
1278
- obj.greenWidth = (((split - (currPhase.redclear / split) - (currPhase.yellow / split) - (currPhase.flashgreen / split)) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1279
- obj.yellowWidth = (((currPhase.yellow / split) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1280
- obj.flashgreen = (((currPhase.flashgreen / split) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1279
+ obj.greenWidth = (((split - (currPhase.redclear / allAdd) - (currPhase.yellow / allAdd) - (currPhase.flashgreen / allAdd)) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1280
+ obj.yellowWidth = (((currPhase.yellow / allAdd) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1281
+ obj.flashgreen = (((currPhase.flashgreen / allAdd) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle)) * 100) + '%'
1281
1282
  } else {
1282
1283
  if (ring.sum) {
1283
1284
  obj.sum = ring.sum