@@ -1383,10 +1383,10 @@ void AnimationEditor::setScroll(int x, int y, bool use_refresh_region)
13831383 int old_scroll_y = 0 ;
13841384 int max_scroll_x;
13851385 int max_scroll_y;
1386- JRegion region = NULL ;
1386+ Region region;
13871387
13881388 if (use_refresh_region) {
1389- region = jwidget_get_drawable_region ( this , JI_GDR_CUTTOPWINDOWS );
1389+ getDrawableRegion (region, kCutTopWindows );
13901390 old_scroll_x = m_scroll_x;
13911391 old_scroll_y = m_scroll_y;
13921392 }
@@ -1404,51 +1404,36 @@ void AnimationEditor::setScroll(int x, int y, bool use_refresh_region)
14041404 int new_scroll_y = m_scroll_y;
14051405 int dx = old_scroll_x - new_scroll_x;
14061406 int dy = old_scroll_y - new_scroll_y;
1407- JRegion reg1 = jregion_new (NULL , 0 );
1408- JRegion reg2 = jregion_new (NULL , 0 );
1409- JRect rect2 = jrect_new (0 , 0 , 0 , 0 );
1407+ Rect rect2;
1408+ Region reg1;
14101409
14111410 jmouse_hide ();
14121411
14131412 // Scroll layers.
1414- jrect_replace (rect2,
1415- this ->rc ->x1 ,
1416- this ->rc ->y1 + HDRSIZE,
1417- this ->rc ->x1 + m_separator_x,
1418- this ->rc ->y2 );
1419- jregion_reset (reg2, rect2);
1420- jregion_copy (reg1, region);
1421- jregion_intersect (reg1, reg1, reg2);
1422- this ->scrollRegion (reg1, 0 , dy);
1413+ rect2 = Rect (this ->rc ->x1 ,
1414+ this ->rc ->y1 + HDRSIZE,
1415+ m_separator_x,
1416+ this ->rc ->y2 - (this ->rc ->y1 + HDRSIZE));
1417+ reg1.createIntersection (region, Region (rect2));
1418+ scrollRegion (reg1, 0 , dy);
14231419
14241420 // Scroll header-frame.
1425- jrect_replace (rect2,
1426- this ->rc ->x1 + m_separator_x + m_separator_w,
1427- this ->rc ->y1 ,
1428- this ->rc ->x2 ,
1429- this ->rc ->y1 + HDRSIZE);
1430- jregion_reset (reg2, rect2);
1431- jregion_copy (reg1, region);
1432- jregion_intersect (reg1, reg1, reg2);
1433- this ->scrollRegion (reg1, dx, 0 );
1421+ rect2 = Rect (this ->rc ->x1 + m_separator_x + m_separator_w,
1422+ this ->rc ->y1 ,
1423+ this ->rc ->x2 - (this ->rc ->x1 + m_separator_x + m_separator_w),
1424+ HDRSIZE);
1425+ reg1.createIntersection (region, Region (rect2));
1426+ scrollRegion (reg1, dx, 0 );
14341427
14351428 // Scroll cels.
1436- jrect_replace (rect2,
1437- this ->rc ->x1 + m_separator_x + m_separator_w,
1438- this ->rc ->y1 + HDRSIZE,
1439- this ->rc ->x2 ,
1440- this ->rc ->y2 );
1441- jregion_reset (reg2, rect2);
1442- jregion_copy (reg1, region);
1443- jregion_intersect (reg1, reg1, reg2);
1444- this ->scrollRegion (reg1, dx, dy);
1429+ rect2 = Rect (this ->rc ->x1 + m_separator_x + m_separator_w,
1430+ this ->rc ->y1 + HDRSIZE,
1431+ this ->rc ->x2 - (this ->rc ->x1 + m_separator_x + m_separator_w),
1432+ this ->rc ->y2 - (this ->rc ->y1 + HDRSIZE));
1433+ reg1.createIntersection (region, Region (rect2));
1434+ scrollRegion (reg1, dx, dy);
14451435
14461436 jmouse_show ();
1447-
1448- jregion_free (region);
1449- jregion_free (reg1);
1450- jregion_free (reg2);
1451- jrect_free (rect2);
14521437 }
14531438}
14541439
0 commit comments