From cdd9d1fc82bb143cfd785683f7ef520cd80e057d Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 11 May 2019 17:04:22 +0200 Subject: [PATCH] BUG FIXED when moving over textarea --- Canvas.js | 4 ++-- FloatingSpace/CodeEditor.js | 9 ++++++++- FloatingSpace/StrategyPart.js | 5 +++++ Globals.js | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Canvas.js b/Canvas.js index 345887e08..52410f6b9 100644 --- a/Canvas.js +++ b/Canvas.js @@ -470,8 +470,8 @@ function newCanvas () { /* When the mouse leaves the canvas, our elements needs to react to the fact that the mouse is over a far away place */ let thisEvent = { - pageX: 100000000000, - pageY: 100000000000 + pageX: VERY_LARGE_NUMBER, + pageY: VERY_LARGE_NUMBER } onMouseOver(thisEvent) } diff --git a/FloatingSpace/CodeEditor.js b/FloatingSpace/CodeEditor.js index 99df8b58f..cd671d28d 100644 --- a/FloatingSpace/CodeEditor.js +++ b/FloatingSpace/CodeEditor.js @@ -98,7 +98,14 @@ function newCodeEditor () { function getContainer (point) { let container - if (thisObject.visitble === true) { + if (thisObject.visible === true) { + if (point.x === VERY_LARGE_NUMBER) { + /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that + anyone can react. In our case, the code editor has a text area that is not part of the canvas, so the event is + triggered. We compensate recognizing this coordinate and returning our container. */ + return thisObject.container + } + if (thisObject.container.frame.isThisPointHere(point, true, false) === true) { return thisObject.container } else { diff --git a/FloatingSpace/StrategyPart.js b/FloatingSpace/StrategyPart.js index 50d0cd8a0..dc854e14f 100644 --- a/FloatingSpace/StrategyPart.js +++ b/FloatingSpace/StrategyPart.js @@ -381,6 +381,11 @@ function newStrategyPart () { function getContainer (point) { let container + if (thisObject.codeEditor !== undefined) { + container = thisObject.codeEditor.getContainer(point) + if (container !== undefined) { return container } + } + container = thisObject.partTitle.getContainer(point) if (container !== undefined) { return container } diff --git a/Globals.js b/Globals.js index e89a71204..6e72065c2 100644 --- a/Globals.js +++ b/Globals.js @@ -151,6 +151,7 @@ const _1_MINUTE_IN_MILISECONDS = 1 * 60 * 1000; let NEW_SESSION_INITIAL_DATE = new Date(); // This value will be overwritten at the viewPort.initialize if the user had a prevous session with this same browser. let INITIAL_ZOOM_LEVEL = -28.25 // This is the zoom level at the view port in which the APP starts. let INITIAL_TIME_PERIOD = ONE_DAY_IN_MILISECONDS // This value will be overwritten at the viewPort.initialize if the user had a prevous session with this same browser. +let VERY_LARGE_NUMBER = 100000000000 let maxDate = new Date(); maxDate.setMilliseconds(0);