Change drawshape to be drawhighlight as we pass it a highlight.

This commit is contained in:
Tim Young 2024-06-06 13:59:59 -07:00
parent 80c1abd5fe
commit 726bafe580

View File

@ -144,7 +144,7 @@ function PrintScreen(WhatPassedIn=-1)
if (ui_helplevel == 2) tmp_queryhighlight = returnHighlightShape("square", rect, "yellow", "none", 0.3); if (ui_helplevel == 2) tmp_queryhighlight = returnHighlightShape("square", rect, "yellow", "none", 0.3);
if (ui_helplevel == 3) tmp_queryhighlight = returnHighlightShape("square", rect, "green", "none", 0.3); if (ui_helplevel == 3) tmp_queryhighlight = returnHighlightShape("square", rect, "green", "none", 0.3);
if (tmp_queryhighlight == null) { } if (tmp_queryhighlight == null) { }
else drawshape(tmp_queryhighlight); else drawhighlight(tmp_queryhighlight);
MainCanvas_ctx.drawImage(imageFromName("queryuser"), rect.sx, rect.sy, rect.deltax, rect.deltay); MainCanvas_ctx.drawImage(imageFromName("queryuser"), rect.sx, rect.sy, rect.deltax, rect.deltay);
@ -181,7 +181,7 @@ function PrintScreen(WhatPassedIn=-1)
else { else {
//console.log("We have something selected."); //console.log("We have something selected.");
var tmp_select = returnHighlightShape("selectbox", ui_selectRect, "green", "none", 0.8); var tmp_select = returnHighlightShape("selectbox", ui_selectRect, "green", "none", 0.8);
drawshape(tmp_select); drawhighlight(tmp_select);
} }
drawSelectMenu(); drawSelectMenu();
@ -492,7 +492,7 @@ function PrintNetworkDevice(ToPrint)
if (deviceHasProblem(ToPrint)) { if (deviceHasProblem(ToPrint)) {
var thshape = returnHighlightShape("square", actionrect, "red", "problem", 0.2); var thshape = returnHighlightShape("square", actionrect, "red", "problem", 0.2);
drawshape(thshape); drawhighlight(thshape);
} }
MainCanvas_ctx.drawImage(imageFromName(dname), rect.spoint.x, rect.spoint.y, rect.width, rect.height); MainCanvas_ctx.drawImage(imageFromName(dname), rect.spoint.x, rect.spoint.y, rect.width, rect.height);
@ -727,12 +727,12 @@ function printHighlights(countof="mouseover") {
var highlight = ui_HighlightArray[index]; var highlight = ui_HighlightArray[index];
//console.log("trying to highlight something: " + JSON.stringify(highlight)); //console.log("trying to highlight something: " + JSON.stringify(highlight));
if (highlight.shapeName == countof) count++; if (highlight.shapeName == countof) count++;
drawshape(highlight); drawhighlight(highlight);
} }
return countof; //the count of the item we were supposed to count return countof; //the count of the item we were supposed to count
} }
function drawshape(highlight) { function drawhighlight(highlight) {
MainCanvas_ctx.fillStyle = highlight.shapeColor; MainCanvas_ctx.fillStyle = highlight.shapeColor;
MainCanvas_ctx.globalAlpha = highlight.opaciticy; //mostly transparent MainCanvas_ctx.globalAlpha = highlight.opaciticy; //mostly transparent
var oldWidth; var oldWidth;