From e47cf18269830265632a7745271a492a73ce3ae3 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Mon, 20 Jun 2022 23:44:02 +1000
Subject: Prevent unexpected-rectangle during sep-swept-area transition

---
 src/components/Tile.vue | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'src/components/Tile.vue')

diff --git a/src/components/Tile.vue b/src/components/Tile.vue
index 29b4856..bcfebe0 100644
--- a/src/components/Tile.vue
+++ b/src/components/Tile.vue
@@ -302,6 +302,15 @@ export default defineComponent({
 				};
 			}
 		},
+		sepSweptAreaHideEdgeClass(): string {
+			if (this.layoutNode.sepSweptArea == null){
+				return '';
+			} else if (this.layoutNode.sepSweptArea.sweptLeft){
+				return 'hide-right-edge';
+			} else {
+				return 'hide-top-edge';
+			}
+		},
 		// For watching layoutNode data
 		pos(){
 			return this.layoutNode.pos;
@@ -490,8 +499,7 @@ export default defineComponent({
 			<info-icon :style="infoIconStyles" class="text-white/10 hover:text-white hover:cursor-pointer"
 				@click.stop="onInfoIconClick" @mousedown.stop @mouseup.stop/>
 		</div>
-		<div :style="sepSweptAreaStyles" ref="sepSweptArea"
-			:class="layoutNode?.sepSweptArea?.sweptLeft ? 'hide-right-edge' : 'hide-top-edge'">
+		<div :style="sepSweptAreaStyles" ref="sepSweptArea" :class="sepSweptAreaHideEdgeClass">
 			<div v-if="layoutNode?.sepSweptArea?.sweptLeft === false"
 				:style="nonleafHeaderStyles" class="flex hover:cursor-pointer"
 				@mouseenter="onMouseEnter" @mouseleave="onMouseLeave" @mousedown="onMouseDown" @mouseup="onMouseUp">
-- 
cgit v1.2.3

