Skip to content

Commit

Permalink
Added help button for distortion arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxcube committed Dec 19, 2023
1 parent c6a29c4 commit 56b466d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<script setup lang="ts">
import type { ReversePixelMapperFactoriesPoolKeyMap } from '@alxcube/lens';
import { computed } from 'vue';
const props = defineProps<{
distortionName?: keyof ReversePixelMapperFactoriesPoolKeyMap;
}>();
const helpUrl = computed(() => {
switch (props.distortionName) {
case 'Affine':
return 'https://alxcube.github.io/lens/guide/distortions/affine.html#affine-distortion-using-control-points';
case 'AffineProjection':
return 'https://alxcube.github.io/lens/guide/distortions/affine.html#affine-distortion-using-affine-matrix';
case 'Arc':
return 'https://alxcube.github.io/lens/guide/distortions/arc.html';
case 'Perspective':
return 'https://alxcube.github.io/lens/guide/distortions/perspective.html#using-control-points';
case 'PerspectiveProjection':
return 'https://alxcube.github.io/lens/guide/distortions/perspective.html#using-forward-mapping-perspective-matrix';
case 'Polynomial':
return 'https://alxcube.github.io/lens/guide/distortions/polynomial.html';
default:
return '';
}
});
</script>

<template>
<VBtn icon v-if="helpUrl" :href="helpUrl" target="_blank" density="compact">
<VIcon>mdi-help-circle</VIcon>
</VBtn>
</template>

<style scoped></style>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import ArgumentsHelpLink from '@/components/playground/input-settings/distortion-settings/ArgumentsHelpLink.vue';
import AffineMatrixInput from '@/components/playground/input-settings/distortion-settings/distortion-arguments/AffineMatrixInput.vue';
import ArcArgumentsInput from '@/components/playground/input-settings/distortion-settings/distortion-arguments/ArcArgumentsInput.vue';
import ControlPoints from '@/components/playground/input-settings/distortion-settings/distortion-arguments/control-points/ControlPoints.vue';
Expand Down Expand Up @@ -117,7 +118,10 @@ const arcArguments = computed(() => distortionArguments.value) as ComputedRef<Ar

<VSwitch label="Generic arguments" v-model="genericArguments" density="compact" />

<h5 class="text-subtitle-2" v-if="distortionName">{{ argumentsTitle }}</h5>
<h5 class="text-subtitle-2" v-if="distortionName">
{{ argumentsTitle }}
<ArgumentsHelpLink :distortion-name="distortionName" />
</h5>
<VMessages
:messages="validationErrors.args"
:active="!!validationErrors.args"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit 56b466d

Please sign in to comment.