refactor: define _IS_CHROMATIC_

This commit is contained in:
syuilo 2023-05-16 19:24:10 +09:00
parent 153eed7d71
commit a35f0d43e4
5 changed files with 7 additions and 2 deletions

View file

@ -4,7 +4,6 @@
<script lang="ts" setup>
import { onMounted, onUnmounted, shallowRef } from 'vue';
import isChromatic from 'chromatic/isChromatic';
const canvasEl = shallowRef<HTMLCanvasElement>();
@ -204,7 +203,7 @@ onMounted(() => {
const vertices = [1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.DYNAMIC_DRAW);
if (isChromatic()) {
if (_IS_CHROMATIC_) {
gl!.uniform1f(u_time, 0);
gl!.drawArrays(gl!.TRIANGLE_STRIP, 0, 4);
} else {