The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix old scroll wheel code

These changes was commited to the Birdfont repository Mon, 15 Jun 2015 21:09:59 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Mon, 15 Jun 2015 21:09:59 +0000]

Updated Files

libbirdfont/SettingsDisplay.vala
libbirdfont/TabContent.vala
libbirdfont/Table.vala
libbirdfont/TableLayout.vala
--- a/libbirdfont/SettingsDisplay.vala +++ b/libbirdfont/SettingsDisplay.vala @@ -220,7 +220,7 @@ } public override void scroll_wheel (double x, double y, double pixeldelta, double dy) { - if (dy > 0) { + if (dy < 0) { foreach (SettingsItem s in tools) { if (s.handle_events && s.button != null) { if (((!) s.button).is_over (x, y)) { @@ -240,7 +240,7 @@ } } - scroll += dy * MainWindow.units; + scroll -= dy * MainWindow.units; if (scroll + allocation.height >= content_height) { scroll = content_height - allocation.height;
--- a/libbirdfont/TabContent.vala +++ b/libbirdfont/TabContent.vala @@ -220,7 +220,7 @@ } if (!MainWindow.get_menu ().show_menu) { - GlyphCanvas.current_display.scroll_wheel (x, y, 15, 0); + GlyphCanvas.current_display.scroll_wheel (x, y, 0, 15); } } @@ -230,7 +230,7 @@ } if (!MainWindow.get_menu ().show_menu) { - GlyphCanvas.current_display.scroll_wheel (x, y, -15, 0); + GlyphCanvas.current_display.scroll_wheel (x, y, 0, -15); } }
--- a/libbirdfont/Table.vala +++ b/libbirdfont/Table.vala @@ -211,7 +211,7 @@ } public override void scroll_wheel (double x, double y, double pixeldelta, double dy) { - scroll += dy * MainWindow.units; + scroll -= dy * MainWindow.units; if (scroll > page_height - allocation.height) { scroll = page_height - allocation.height;
--- a/libbirdfont/TableLayout.vala +++ b/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 (); }