mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Replace jwidget_scroll with Widget::scrollRegion().
This commit is contained in:
parent
2e87676d70
commit
01b6afb531
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
// ===============================================================
|
||||
|
@ -325,9 +325,9 @@ void Editor::setEditorScroll(int x, int y, int use_refresh_region)
|
||||
|
||||
if (use_refresh_region) {
|
||||
// Move screen with blits
|
||||
jwidget_scroll(this, region,
|
||||
oldScroll.x - newScroll.x,
|
||||
oldScroll.y - newScroll.y);
|
||||
this->scrollRegion(region,
|
||||
oldScroll.x - newScroll.x,
|
||||
oldScroll.y - newScroll.y);
|
||||
|
||||
jregion_free(region);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user