FIX: Clamp ring bar value
This commit is contained in:
@@ -127,8 +127,14 @@ const deviceStore = useDeviceStore()
|
|||||||
const devicePosition = computed(() => deviceStore.position || 0)
|
const devicePosition = computed(() => deviceStore.position || 0)
|
||||||
const minValue = computed(() => deviceStore.activeValue?.valueMin || 0)
|
const minValue = computed(() => deviceStore.activeValue?.valueMin || 0)
|
||||||
const maxValue = computed(() => deviceStore.activeValue?.valueMax || 100)
|
const maxValue = computed(() => deviceStore.activeValue?.valueMax || 100)
|
||||||
const ringValue = computed(
|
const ringValue = computed(() =>
|
||||||
() => ((devicePosition.value - minValue.value) / (maxValue.value - minValue.value)) * 100
|
Math.min(
|
||||||
|
Math.max(
|
||||||
|
minValue.value,
|
||||||
|
((devicePosition.value - minValue.value) / (maxValue.value - minValue.value)) * 100
|
||||||
|
),
|
||||||
|
maxValue.value
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
const previewDeviceImages = {
|
const previewDeviceImages = {
|
||||||
|
|||||||
Reference in New Issue
Block a user