From b45cd3e07e58ca0dd69bde346d98b74fe6e3dc37 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 4 May 2014 21:32:13 -0300 Subject: [PATCH] Minor changes in Widget::scrollRegion() --- src/ui/widget.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/ui/widget.cpp b/src/ui/widget.cpp index 63cc2e974..4a075f457 100644 --- a/src/ui/widget.cpp +++ b/src/ui/widget.cpp @@ -1035,27 +1035,26 @@ void Widget::invalidateRegion(const Region& region) void Widget::scrollRegion(const Region& region, int dx, int dy) { - if (dx != 0 || dy != 0) { - Region reg2 = region; - reg2.offset(dx, dy); - reg2.createIntersection(reg2, region); - reg2.offset(-dx, -dy); + if (dx == 0 && dy == 0) + return; - // Move screen pixels - jmouse_hide(); - ui::_move_region(reg2, dx, dy); - jmouse_show(); + Region reg2 = region; + reg2.offset(dx, dy); + reg2.createIntersection(reg2, region); + reg2.offset(-dx, -dy); - reg2.offset(dx, dy); + // Move screen pixels + ui::_move_region(reg2, dx, dy); - m_updateRegion.createUnion(m_updateRegion, region); - m_updateRegion.createSubtraction(m_updateRegion, reg2); + reg2.offset(dx, dy); - mark_dirty_flag(this); + m_updateRegion.createUnion(m_updateRegion, region); + m_updateRegion.createSubtraction(m_updateRegion, reg2); - // Generate the kPaintMessage messages for the widget's m_updateRegion - flushRedraw(); - } + mark_dirty_flag(this); + + // Generate the kPaintMessage messages for the widget's m_updateRegion + flushRedraw(); } class DeleteGraphicsAndBitmap {