Skip to content
Snippets Groups Projects
Commit 57bde8a0 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Merge branch 'dd_lightbar_menu_DrawPartial_width_check_update' into 'master'

DDLightbarMenu: DrawPartial() width check update (previously it wasn't re-drawing the last character of the item text)

See merge request !398
parents 8c9bea8e 3b33ea11
No related branches found
No related tags found
1 merge request!398DDLightbarMenu: DrawPartial() width check update (previously it wasn't re-drawing the last character of the item text)
...@@ -1244,21 +1244,11 @@ function DDLightbarMenu_DrawPartial(pStartX, pStartY, pWidth, pHeight, pSelected ...@@ -1244,21 +1244,11 @@ function DDLightbarMenu_DrawPartial(pStartX, pStartY, pWidth, pHeight, pSelected
// Fix the width & height if needed // Fix the width & height if needed
var width = pWidth; var width = pWidth;
if (width > (this.size.width - pStartX + 1)) if (width > (this.size.width - pStartX + 5)) // Used to be + 1, but then this wouldn't draw the last character in the item text
width = (this.size.width - pStartX + 1); width = (this.size.width - pStartX + 5);
var height = pHeight; var height = pHeight;
if (height > (this.size.height - pStartY + 1)) if (height > (this.size.height - pStartY + 1))
height = (this.size.height - pStartY + 1); height = (this.size.height - pStartY + 1);
/*
// Temporary
if (user.is_sysop)
{
console.print("\x01n\r\n");
printf("DrawPartial 1 - X, Y, width, height: %d, %d; %d, %d\r\n", pStartX, pStartY, width, height);
console.pause();
}
// End Temporary
*/
var selectedItemIndexes = { }; // For multi-select mode var selectedItemIndexes = { }; // For multi-select mode
if (typeof(pSelectedItemIndexes) == "object") if (typeof(pSelectedItemIndexes) == "object")
...@@ -1375,16 +1365,6 @@ function DDLightbarMenu_DrawPartial(pStartX, pStartY, pWidth, pHeight, pSelected ...@@ -1375,16 +1365,6 @@ function DDLightbarMenu_DrawPartial(pStartX, pStartY, pWidth, pHeight, pSelected
// Write the menu items // Write the menu items
if (writeMenuItems) if (writeMenuItems)
{ {
/*
// Temporary
if (user.is_sysop)
{
console.print("\x01n\r\n");
console.print("itemTxtStartIdx: " + itemTxtStartIdx + ", itemLen: " + itemLen + "\r\n");
console.pause();
}
// End Temporary
*/
var blankItemTextFormatStr = "\x01n%" + itemLen + "s"; var blankItemTextFormatStr = "\x01n%" + itemLen + "s";
for (var lineNum = pStartY + this.pos.y - 1; lineNum <= lastLineNum; ++lineNum) for (var lineNum = pStartY + this.pos.y - 1; lineNum <= lastLineNum; ++lineNum)
{ {
...@@ -1437,16 +1417,6 @@ function DDLightbarMenu_DrawPartialAbs(pStartX, pStartY, pWidth, pHeight, pSelec ...@@ -1437,16 +1417,6 @@ function DDLightbarMenu_DrawPartialAbs(pStartX, pStartY, pWidth, pHeight, pSelec
var width = pWidth; var width = pWidth;
var startX = pStartX - this.pos.x + 1; var startX = pStartX - this.pos.x + 1;
var startY = pStartY - this.pos.y + 1; var startY = pStartY - this.pos.y + 1;
/*
// Temporary
if (user.is_sysop)
{
console.print("\x01n\r\n");
printf("Here 1 - X, Y, width, height: %d, %d; %d, %d\r\n", startX, startY, width, height);
console.pause();
}
// End Temporary
*/
if (startX < 1) if (startX < 1)
{ {
var XDiff = 1 - startX; var XDiff = 1 - startX;
...@@ -1459,16 +1429,6 @@ function DDLightbarMenu_DrawPartialAbs(pStartX, pStartY, pWidth, pHeight, pSelec ...@@ -1459,16 +1429,6 @@ function DDLightbarMenu_DrawPartialAbs(pStartX, pStartY, pWidth, pHeight, pSelec
startY += YDiff; startY += YDiff;
height -= YDiff; height -= YDiff;
} }
/*
// Temporary
if (user.is_sysop)
{
console.print("\x01n\r\n");
printf("Here 2 - X, Y, width, height: %d, %d; %d, %d\r\n", startX, startY, width, height);
console.pause();
}
// End Temporary
*/
this.DrawPartial(startX, startY, width, height, pSelectedItemIndexes); this.DrawPartial(startX, startY, width, height, pSelectedItemIndexes);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment