Skip to content

Commit

Permalink
changeable UI stroke width
Browse files Browse the repository at this point in the history
  • Loading branch information
monman53 committed Jun 14, 2024
1 parent 158e03b commit e56ae88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Controller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ const replaceApple = (cx: number, cy: number, r: number) => {
<tr>
<td><label><input type="checkbox" v-model="options.opticalAxis"> Optical axis</label></td>
</tr>
<tr>
<td>UI stroke width</td>
<td><input type="range" min="0" max="3" step="0.01" v-model.number="style.widthUI"></td>
</tr>
</template>
<!-- Field -->
<template v-if="options.advanced">
Expand Down
4 changes: 2 additions & 2 deletions src/SVG/SVG.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref, onMounted } from 'vue'
import { state, lights, lens, sensor, field, options, lensR, lensD, infR, fNumber } from '../globals'
import { state, lights, lens, sensor, style, options, lensR, lensD, infR, fNumber } from '../globals'
import * as h from '../handlers'
import Grid from './Grid.vue'
Expand All @@ -24,7 +24,7 @@ const svgViewBox = computed(() => {
})
const strokeWidth = computed(() => {
const scale = 1 / state.value.scale
const scale = style.value.widthUI / state.value.scale
const scaleFd = 2
const scaleBg = 4
return {
Expand Down
2 changes: 2 additions & 0 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export const style0 = () => {
// Rays
rayWidth: 0.2,
rayIntensity: 0.5,
// UI
widthUI: 1.0,
}
}
export const style = ref(style0())
Expand Down

0 comments on commit e56ae88

Please sign in to comment.