Skip to content

Commit 224ecc4

Browse files
committedSep 7, 2023
feat(Lensflare): fix linter errors
1 parent c895fe1 commit 224ecc4

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed
 

‎playground/src/pages/LensflareDemo.vue

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { shallowRef } from 'vue'
2+
import { shallowRef, watch } from 'vue'
33
import { TresCanvas, useRenderLoop } from '@tresjs/core'
44
import { Levioso, Lensflare, Dodecahedron } from '@tresjs/cientos';
55
import { Color, MeshPhongMaterial } from 'three';
@@ -32,7 +32,7 @@ const { onLoop } = useRenderLoop();
3232
onLoop(() => {
3333
if (!lightRef.value) return
3434
35-
if (Math.random() > 0.99) {
35+
if (Math.random() > 0.99) {
3636
lightRef.value.color = new Color(randomColor());
3737
flarePropsRef.value = getFlareProps()
3838
}
@@ -213,13 +213,15 @@ const rockMaterial = new MeshPhongMaterial({ color: 0x123141, specular: 0xffffff
213213
214214
watch(() => [
215215
seedRef.value,
216-
oversizeSizeMin.value, oversizeSizeMax.value, oversizeLengthMin.value, oversizeLengthMax.value,
216+
oversizeSizeMin.value, oversizeSizeMax.value, oversizeLengthMin.value, oversizeLengthMax.value,
217217
oversizeColorA.value, oversizeColorB.value, oversizeColorC.value, oversizeSeed.value,
218-
bodySizeMin.value, bodySizeMax.value, bodyLengthMin.value, bodyLengthMax.value,
218+
bodySizeMin.value, bodySizeMax.value, bodyLengthMin.value, bodyLengthMax.value,
219219
bodyColorA.value, bodyColorB.value, bodyColorC.value, bodySeed.value,
220-
frontSizeMin.value, frontSizeMax.value, frontLengthMin.value, frontLengthMax.value, frontOffset.value, frontDistance.value,
220+
frontSizeMin.value, frontSizeMax.value, frontLengthMin.value, frontLengthMax.value,
221+
frontOffset.value, frontDistance.value,
221222
frontColorA.value, frontColorB.value, frontColorC.value, frontSeed.value,
222-
backSizeMin.value, backSizeMax.value, backLengthMin.value, backLengthMax.value, backDistance.value, backOffset.value,
223+
backSizeMin.value, backSizeMax.value, backLengthMin.value, backLengthMax.value,
224+
backDistance.value, backOffset.value,
223225
backColorA.value, backColorB.value, backColorC.value, backSeed.value,
224226
], updateSeedProps);
225227
@@ -240,7 +242,7 @@ const rockMaterial = new MeshPhongMaterial({ color: 0x123141, specular: 0xffffff
240242
</TresPointLight>
241243
</Levioso>
242244
<TresPointLight :color="new Color(1, 1, 1)" :intensity="2000" :position="[10, 5, 0]">
243-
<Lensflare :seed="seedRef" :seedProps="seedPropsRef" />
245+
<Lensflare :seed="seedRef" :seed-props="seedPropsRef" />
244246
</TresPointLight>
245247
<Dodecahedron v-for="{ key, position, rotation, scale } in rocks" :key="key" :material="rockMaterial"
246248
:position="position" :rotation="rotation" :scale="scale" />

‎src/core/abstractions/Lensflare/component.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Lensflare, LensflareElement } from 'three/examples/jsm/objects/Lensflar
33
import { TextureLoader } from 'three'
44
import { watch, shallowRef, onMounted, onUnmounted } from 'vue'
55
import { normalizeColor } from '@tresjs/core'
6-
import { LensflareElementProps, partialLensflarePropsArrayToLensflarePropsArray, SeedProps } from '.'
6+
import { LensflareElementProps, partialLensflarePropsArrayToLensflarePropsArray as fillInProps, SeedProps } from '.'
77
88
const props = withDefaults(
99
defineProps<{
@@ -102,11 +102,11 @@ onUnmounted(() => {
102102
103103
onMounted(() => {
104104
lensflareRef.value?.add(threeLensflare);
105-
lensflareElementPropsArray.value = partialLensflarePropsArrayToLensflarePropsArray(props.flare, props.seed, props.seedProps);
105+
lensflareElementPropsArray.value = fillInProps(props.flare, props.seed, props.seedProps);
106106
})
107107
108108
watch(() => [props.flare, props.seed, props.seedProps], () => {
109-
lensflareElementPropsArray.value = partialLensflarePropsArrayToLensflarePropsArray(props.flare, props.seed, props.seedProps);
109+
lensflareElementPropsArray.value = fillInProps(props.flare, props.seed, props.seedProps);
110110
})
111111
112112
watch(() => props.scale, () => {

‎src/core/abstractions/Lensflare/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const partialLensflarePropsArrayToLensflarePropsArray = (
2424
partialPropsArrayToPropsArray<LensflareElementProps>(
2525
partialProps,
2626
seed,
27-
(seed) => getSeededLensflareElementProps(seed, seedProps),
27+
seed => getSeededLensflareElementProps(seed, seedProps),
2828
defaultElement,
2929
)
3030

0 commit comments

Comments
 (0)
Please sign in to comment.