FIX: Use detentCount for device preview
This commit is contained in:
@@ -124,17 +124,8 @@ const appStore = useAppStore()
|
|||||||
const deviceStore = useDeviceStore()
|
const deviceStore = useDeviceStore()
|
||||||
|
|
||||||
const devicePosition = computed(() => deviceStore.position || 0)
|
const devicePosition = computed(() => deviceStore.position || 0)
|
||||||
const minValue = computed(() => deviceStore.activeValue?.valueMin || 0)
|
const maxDetent = computed(() => deviceStore.activeValue?.haptic?.detentCount || 100)
|
||||||
const maxValue = computed(() => deviceStore.activeValue?.valueMax || 100)
|
const ringValue = computed(() => (devicePosition.value / maxDetent.value) * 100)
|
||||||
const ringValue = computed(() =>
|
|
||||||
Math.min(
|
|
||||||
Math.max(
|
|
||||||
minValue.value,
|
|
||||||
((devicePosition.value - minValue.value) / (maxValue.value - minValue.value)) * 100
|
|
||||||
),
|
|
||||||
maxValue.value
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
const previewDeviceImages = {
|
const previewDeviceImages = {
|
||||||
nanoOne: RenderNanoOne,
|
nanoOne: RenderNanoOne,
|
||||||
|
|||||||
Reference in New Issue
Block a user