vurtun / nuklear

A single-header ANSI C gui library
13.68k stars 1.11k forks source link

Tooltip displayed on hover even when widget not visible #864

Open 0x0203 opened 5 years ago

0x0203 commented 5 years ago

The tooltip example in overview.c is displayed even when the area over which the tooltip should be activated is not visible in the window. E.g.: activate overview, expand the popup section of the tree, then shrink the overview window until the bottom edge cuts off the 'hover me for tooltip' label. Move the mouse under the window to where the label would be to see behavior.

I'm not sure if this should be fixed by making the overview demo more intelligent or by moving the hover check into the nk_tooltip widget itself by taking a bounds rect that can automatically check the current mouse position against the bounds and the appropriate clipping regions. My inclination would be the latter, but that would be an API breaking change. Thoughts?

0x0203 commented 5 years ago

A similar problem exists for the right click popup behavior, although in those cases it doesn't occur when another window is obscuring the right click region like the mouse over does.

lingtorp commented 5 years ago

A screenshot or two would be helpful as would a minimal code sample.