mirror of
https://github.com/lbonn/rofi
synced 2024-11-28 06:40:18 +00:00
Fix scrolling on edges
This commit is contained in:
parent
ae043d5246
commit
e53705de11
1 changed files with 2 additions and 1 deletions
|
@ -135,10 +135,11 @@ void scrollbar_draw ( scrollbar *sb )
|
|||
unsigned int scrollbar_clicked ( scrollbar *sb, int y )
|
||||
{
|
||||
if ( sb != NULL ) {
|
||||
y = MIN ( MAX ( 1, y ), sb->h - 1 ) - 1;
|
||||
const short bh = sb->h - 2;
|
||||
float sec = ( ( bh ) / (float) sb->length );
|
||||
unsigned int sel = y / sec;
|
||||
return sel;
|
||||
return MIN ( sel, sb->length - 1 );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue