Fixed a bug where clicking on a line would change how things were
viewed. It turned out to be a rather bizarre bug based off of !== null not working properly.
This commit is contained in:
parent
3e902cba95
commit
0e9a6d1a15
16
Web/ui.js
16
Web/ui.js
@ -228,9 +228,10 @@ function CheckForActions(actionPoint, action) {
|
|||||||
var checkit = false;
|
var checkit = false;
|
||||||
var inside = false;
|
var inside = false;
|
||||||
for (var index = 0; index < uiActions.length; index++) {
|
for (var index = 0; index < uiActions.length; index++) {
|
||||||
if (action == "leftclick" && uiActions[index].funcLeftClick !== null) checkit = true;
|
checkit = true;
|
||||||
if (action == "rightclick" && uiActions[index].funcRightClick !== null) checkit = true;
|
if (action == "leftclick" && uiActions[index].funcLeftClick == null) checkit = false;
|
||||||
if (action == "mouseover" && uiActions[index].funcMouseover !== null) checkit = true;
|
if (action == "rightclick" && uiActions[index].funcRightClick == null) checkit = false;
|
||||||
|
if (action == "mouseover" && uiActions[index].funcMouseover == null) checkit = false;
|
||||||
checklocation = uiActions[index];
|
checklocation = uiActions[index];
|
||||||
var point = newPointFromPair(actionPoint.pageX - checklocation.shapePoints.offsetx, actionPoint.pageY - checklocation.shapePoints.offsety);
|
var point = newPointFromPair(actionPoint.pageX - checklocation.shapePoints.offsetx, actionPoint.pageY - checklocation.shapePoints.offsety);
|
||||||
if (checkit) {
|
if (checkit) {
|
||||||
@ -258,14 +259,16 @@ function CheckForActions(actionPoint, action) {
|
|||||||
//console.log("Is inside");
|
//console.log("Is inside");
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "leftclick":
|
case "leftclick":
|
||||||
if (checklocation.funcLeftClick != null) {
|
if (checklocation.funcLeftClick == null) { }
|
||||||
|
else {
|
||||||
checklocation.funcLeftClick(actionPoint, checklocation);
|
checklocation.funcLeftClick(actionPoint, checklocation);
|
||||||
//console.log("Successfully did a UI action");
|
//console.log("Successfully did a left-click UI action");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "mouseover":
|
case "mouseover":
|
||||||
if (checklocation.funcMouseover != null) {
|
if (checklocation.funcMouseover == null) { }
|
||||||
|
else {
|
||||||
checklocation.funcMouseover(actionPoint, checklocation);
|
checklocation.funcMouseover(actionPoint, checklocation);
|
||||||
//console.log("Successfully did a UI action");
|
//console.log("Successfully did a UI action");
|
||||||
return true;
|
return true;
|
||||||
@ -677,6 +680,7 @@ function actionStruct(shapeText, shapePoints, theObject=null, funcLeftClick=null
|
|||||||
funcRightClick: funcRightClick,
|
funcRightClick: funcRightClick,
|
||||||
funcMouseover: funcMouseover,
|
funcMouseover: funcMouseover,
|
||||||
}
|
}
|
||||||
|
//if (shapeText == "line") console.log("Creating a line: " + JSON.stringify(struct));
|
||||||
shapePoints.shapeText = shapeText;
|
shapePoints.shapeText = shapeText;
|
||||||
return struct;
|
return struct;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user