2021-02-13 01:51:01 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2021-03-29 01:50:33 +00:00
|
|
|
<vue-draggable-resizable
|
2021-04-01 23:01:36 +00:00
|
|
|
@dragstop="onDragStop"
|
2021-04-24 00:20:11 +00:00
|
|
|
:grid="[currentAscii.blockWidth, currentAscii.blockHeight]"
|
|
|
|
:min-width="8 * 100"
|
|
|
|
:max-width="8 * 150"
|
|
|
|
:min-height="13 * 4"
|
|
|
|
:max-height="13 * 4"
|
2021-04-01 23:01:36 +00:00
|
|
|
style="z-index: 5;"
|
2021-04-24 00:20:11 +00:00
|
|
|
:w="debugPanelState.w"
|
|
|
|
:h="debugPanelState.h"
|
|
|
|
:x="debugPanelState.x"
|
|
|
|
:y="debugPanelState.y"
|
2021-02-13 01:51:01 +00:00
|
|
|
>
|
2021-04-01 23:01:36 +00:00
|
|
|
|
|
|
|
<t-card style="height: 100%;">
|
2021-04-24 00:20:11 +00:00
|
|
|
<span class="ml-5" v-html="`Tool: ${getToolName}`"></span>
|
|
|
|
<span class="ml-5" v-html="`FgColour: ${$store.getters.getFgColour}`"></span>
|
|
|
|
<span class="ml-5" v-html="`BgColor: ${$store.getters.getBgColour}`"></span>
|
|
|
|
<span class="ml-5" v-html="`Char: ${$store.getters.getToolbarState.selectedChar}`"></span>
|
2021-03-29 05:10:31 +00:00
|
|
|
|
2021-04-24 00:20:11 +00:00
|
|
|
<span class="ml-5" v-html="`canvasX: ${canvasX}`"></span>
|
|
|
|
<span class="ml-5" v-html="`canvasY: ${canvasY}`"></span>
|
2021-03-29 01:50:33 +00:00
|
|
|
</t-card>
|
2021-04-01 23:01:36 +00:00
|
|
|
|
2021-02-13 01:51:01 +00:00
|
|
|
</vue-draggable-resizable>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
2021-04-24 00:20:11 +00:00
|
|
|
|
2021-02-13 01:51:01 +00:00
|
|
|
export default {
|
2021-04-24 00:20:11 +00:00
|
|
|
created() {
|
|
|
|
this.panel.x = this.debugPanelState.x
|
|
|
|
this.panel.y = this.debugPanelState.y
|
|
|
|
this.panel.w = this.debugPanelState.w
|
|
|
|
this.panel.h = this.debugPanelState.h
|
|
|
|
},
|
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: () => ({
|
2021-04-24 00:20:11 +00:00
|
|
|
panel: {
|
|
|
|
w: 0,
|
|
|
|
h: 0,
|
2021-02-13 01:51:01 +00:00
|
|
|
x: 100,
|
|
|
|
y: 100,
|
|
|
|
},
|
2021-04-01 23:01:36 +00:00
|
|
|
throttle: true,
|
2021-02-13 01:51:01 +00:00
|
|
|
}),
|
2021-04-02 02:07:49 +00:00
|
|
|
computed: {
|
|
|
|
getToolName() {
|
|
|
|
return this.$store.getters.getToolbarIcons[this.$store.getters.getCurrentTool] ? this.$store.getters.getToolbarIcons[this.$store.getters.getCurrentTool].name : 'none'
|
2021-04-24 00:20:11 +00:00
|
|
|
},
|
|
|
|
debugPanelState() {
|
|
|
|
return this.$store.getters.getDebugPanelState
|
|
|
|
},
|
|
|
|
currentAscii() {
|
|
|
|
return this.$store.getters.currentAscii;
|
|
|
|
},
|
2021-04-02 02:07:49 +00:00
|
|
|
},
|
2021-03-29 01:50:33 +00:00
|
|
|
watch: {},
|
2021-02-13 01:51:01 +00:00
|
|
|
methods: {
|
2021-04-24 00:20:11 +00:00
|
|
|
onResize(x, y, w, h) {
|
|
|
|
this.panel.x = x;
|
|
|
|
this.panel.y = y;
|
|
|
|
this.panel.w = w;
|
|
|
|
this.panel.h = h;
|
|
|
|
|
|
|
|
this.$store.commit("changeDebugPanelState", this.panel)
|
2021-02-13 01:51:01 +00:00
|
|
|
},
|
2021-04-01 23:01:36 +00:00
|
|
|
onDragStop(x, y) {
|
2021-04-24 00:20:11 +00:00
|
|
|
this.panel.x = x;
|
|
|
|
this.panel.y = y;
|
2021-04-01 23:01:36 +00:00
|
|
|
|
2021-04-24 00:20:11 +00:00
|
|
|
this.$store.commit("changeDebugPanelState", this.panel)
|
2021-02-13 01:51:01 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|