Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script setup lang="ts">
import { useFPS } from "@magic/utils/fps";
import { useFPS } from "@magic/utils/fps";
import GText from "../../graph-core/GText.vue";

const { fps, slowFrameCount, slowFrameRatio } = useFPS();
const { fps, slowFrameCount, slowFrameRatio } = useFPS();
</script>

<template>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap in GText

<div class="text-white text-end">
<GText class="text-end">
<div>FPS: {{ fps }}</div>
<div>Slow Frame Count: {{ slowFrameCount }}</div>
<div>Slow Frame Ratio: {{ slowFrameRatio.toFixed(2) }}</div>
</div>
</GText>
</template>
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<script setup lang="ts">
import { nonNullGraph as graph } from "../../../../shared/globalGraph";
import { nonNullGraph as graph } from "../../../../shared/globalGraph";

import { computed } from "vue";

const coords = computed(() => {
const {
coords: { x, y },
} = graph.value.graphAtMousePosition.value;
return { x: Math.round(x), y: Math.round(y) };
});
import { computed } from "vue";
import GText from "../../graph-core/GText.vue";

const hoveredItems = computed(() => {
const { items } = graph.value.graphAtMousePosition.value;
return items.map(
(item) => `${item.graphType} - ${item.shape.name} (${item.id})`
);
});
const coords = computed(() => {
const {
coords: { x, y },
} = graph.value.graphAtMousePosition.value;
return { x: Math.round(x), y: Math.round(y) };
});

const hoveredItems = computed(() => {
const { items } = graph.value.graphAtMousePosition.value;
return items.map(
(item) => `${item.graphType} - ${item.shape.name} (${item.id})`
);
});
</script>

<template>
<div class="text-white text-end">
<GText class="text-end">
<div>Cursor At: (X = {{ coords.x }}, Y = {{ coords.y }})</div>
<div>Items Hovered: {{ hoveredItems }}</div>
</div>
</GText>
</template>
Loading