Replace jwidget_scroll with Widget::scrollRegion().

This commit is contained in:
David Capello 2012-03-20 16:13:37 -03:00
parent 2e87676d70
commit 01b6afb531
4 changed files with 13 additions and 12 deletions

View File

@ -1456,7 +1456,7 @@ void AnimationEditor::setScroll(int x, int y, bool use_refresh_region)
jregion_reset(reg2, rect2);
jregion_copy(reg1, region);
jregion_intersect(reg1, reg1, reg2);
jwidget_scroll(this, reg1, 0, dy);
this->scrollRegion(reg1, 0, dy);
// Scroll header-frame.
jrect_replace(rect2,
@ -1467,7 +1467,7 @@ void AnimationEditor::setScroll(int x, int y, bool use_refresh_region)
jregion_reset(reg2, rect2);
jregion_copy(reg1, region);
jregion_intersect(reg1, reg1, reg2);
jwidget_scroll(this, reg1, dx, 0);
this->scrollRegion(reg1, dx, 0);
// Scroll cels.
jrect_replace(rect2,
@ -1478,7 +1478,7 @@ void AnimationEditor::setScroll(int x, int y, bool use_refresh_region)
jregion_reset(reg2, rect2);
jregion_copy(reg1, region);
jregion_intersect(reg1, reg1, reg2);
jwidget_scroll(this, reg1, dx, dy);
this->scrollRegion(reg1, dx, dy);
jmouse_show();

View File

@ -1196,7 +1196,7 @@ void Widget::invalidateRegion(const JRegion region)
}
}
void jwidget_scroll(JWidget widget, JRegion region, int dx, int dy)
void Widget::scrollRegion(JRegion region, int dx, int dy)
{
if (dx != 0 || dy != 0) {
JRegion reg2 = jregion_new(NULL, 0);
@ -1213,13 +1213,13 @@ void jwidget_scroll(JWidget widget, JRegion region, int dx, int dy)
jregion_translate(reg2, dx, dy);
jregion_union(widget->update_region, widget->update_region, region);
jregion_subtract(widget->update_region, widget->update_region, reg2);
jregion_union(this->update_region, this->update_region, region);
jregion_subtract(this->update_region, this->update_region, reg2);
mark_dirty_flag(widget);
mark_dirty_flag(this);
// Generate the JM_DRAW messages for the widget's update_region
jwidget_flush_redraw(widget);
jwidget_flush_redraw(this);
jregion_free(reg2);
}

View File

@ -80,7 +80,6 @@ void jwidget_set_bg_color(JWidget widget, int color);
/* drawing methods */
void jwidget_flush_redraw(JWidget widget);
void jwidget_scroll(JWidget widget, JRegion region, int dx, int dy);
/* signal handle */
@ -281,6 +280,8 @@ public:
void invalidateRect(const JRect rect);
void invalidateRegion(const JRegion region);
void scrollRegion(JRegion region, int dx, int dy);
// ===============================================================
// GUI MANAGER
// ===============================================================

View File

@ -325,7 +325,7 @@ void Editor::setEditorScroll(int x, int y, int use_refresh_region)
if (use_refresh_region) {
// Move screen with blits
jwidget_scroll(this, region,
this->scrollRegion(region,
oldScroll.x - newScroll.x,
oldScroll.y - newScroll.y);