asciibird/src/components/DebugPanel.vue

59 lines
1.4 KiB
Vue
Raw Normal View History

2021-02-13 01:51:01 +00:00
<template>
<div>
<vue-draggable-resizable
@dragstop="onDragStop"
style="z-index: 5;"
:min-width="200"
:max-width="500"
:min-height="200"
:max-height="500"
:x="$store.getters.getDebugPanelState.x"
:y="$store.getters.getDebugPanelState.y"
2021-02-13 01:51:01 +00:00
>
<t-card style="height: 100%;">
2021-03-29 05:10:31 +00:00
<p v-html="`Tool: ${$store.getters.getCurrentTool}`"></p>
<p v-html="`FgColour: ${$store.getters.getFgColour}`"></p>
<p v-html="`BgColor: ${$store.getters.getBgColour}`"></p>
2021-03-29 08:21:23 +00:00
<p v-html="`Char: ${$store.getters.getToolbarState.selectedChar}`"></p>
2021-03-29 05:10:31 +00:00
<p v-html="`canvasX: ${canvasX}`"></p>
<p v-html="`canvasY: ${canvasY}`"></p>
</t-card>
2021-02-13 01:51:01 +00:00
</vue-draggable-resizable>
</div>
</template>
<script>
export default {
created() {},
2021-02-13 01:51:01 +00:00
name: "DebugPanel",
2021-03-29 05:10:31 +00:00
props: ["canvasX", "canvasY"],
2021-02-13 01:51:01 +00:00
data: () => ({
floating: {
width: 0,
height: 0,
x: 100,
y: 100,
},
throttle: true,
2021-02-13 01:51:01 +00:00
}),
computed: {},
watch: {},
2021-02-13 01:51:01 +00:00
methods: {
onResize(x, y, width, height) {
this.floating.x = x;
this.floating.y = y;
this.floating.width = width;
this.floating.height = height;
},
onDragStop(x, y) {
2021-02-13 01:51:01 +00:00
this.floating.x = x;
this.floating.y = y;
this.$store.commit("changeDebugPanelState", {x: x, y: y})
2021-02-13 01:51:01 +00:00
},
},
};
</script>