The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Fix old scroll wheel code

Changes made to libbirdfont/TableLayout.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libbirdfont/TableLayout.vala +++ libbirdfont/TableLayout.vala @@ -212,22 +212,20 @@ } public override void scroll_wheel (double x, double y, double pixeldelta, double dy) { - scroll += dy * MainWindow.units; - - if (dy > 0){ - if (scroll + allocation.height >= content_height) { - scroll = content_height - allocation.height; - - if (scroll < 0) { - scroll = 0; - } - } - } else { + scroll -= dy * MainWindow.units; + + if (scroll + allocation.height >= content_height) { + scroll = content_height - allocation.height; + if (scroll < 0) { scroll = 0; - } + } } + if (scroll < 0) { + scroll = 0; + } + update_scrollbar (); GlyphCanvas.redraw (); }