Skip to content

Commit

Permalink
Print pause tooltip in small letters
Browse files Browse the repository at this point in the history
This fixes the following bug:
1. Activate tooltips in the options.
2. Hover over the pause button, see its tooltip in small font (correct).
3. Still over the pause button, move the mouse to the screen edge.

Expected: Pause tooltip remains in small font.
Instead: Pause tooltip prints in big font.
  • Loading branch information
SimonN committed Apr 15, 2024
1 parent 0658029 commit 0b54543
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/game/panel/tooltip.d
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,18 @@ struct Tooltip {

static bool isAboutMapClicks(in IdSet ids) pure nothrow @safe @nogc
{
return ids >= ID.forceLeft; // Contains one of these high bits.
return ids % ID.forceLeft == 0 // Contains no important low bit
&& ids >= ID.forceLeft; // Contains at least one high bit.
/*
* Both sides of the && are necessary.
*
* Ruling out the low bits prevents a bug where the scrolling tooltip
* (unshown) for mouse at screen edge prints the pause button tooltip
* (shown) in big font instead of the correct small font.
*
* Requiring the map clicks prevents a bug where the skill buttons
* print their tooltips in big font instead of the correct small font.
*/
}

string format()
Expand Down

0 comments on commit 0b54543

Please sign in to comment.