Index: af/gr/cocoa/gr_CocoaGraphics.mm =================================================================== RCS file: /cvsroot/abi/src/af/gr/cocoa/gr_CocoaGraphics.mm,v retrieving revision 1.73 diff -c -r1.73 gr_CocoaGraphics.mm *** af/gr/cocoa/gr_CocoaGraphics.mm 2 Oct 2004 20:56:22 -0000 1.73 --- af/gr/cocoa/gr_CocoaGraphics.mm 5 Oct 2004 00:00:10 -0000 *************** *** 778,885 **** * there can be a sizeable discrepancy (in local units) between the scroll that was requested and the * reported exposed area. I am therefore marking an extra 1-pixel border around the exposed display area. */ - if (offset.width > 0) - { - if (offset.width < bounds.size.width) - { - if (offset.height > 0) - { - if (offset.height < bounds.size.height) - { - NSRect tmp; - tmp.origin.x = -1.0 + bounds.origin.x + offset.width; - tmp.origin.y = -1.0 + bounds.origin.y; - tmp.size.width = 2.0 + bounds.size.width - offset.width; - tmp.size.height = 2.0 + offset.height; - [m_pWin setNeedsDisplayInRect:tmp]; ! bounds.size.width = offset.width; ! } ! } ! else if (offset.height < 0) ! { ! if ((-offset.height) < bounds.size.height) ! { ! NSRect tmp; ! tmp.origin.x = -1.0 + bounds.origin.x + offset.width; ! tmp.origin.y = -1.0 + bounds.origin.y + bounds.size.height + offset.height; ! tmp.size.width = 2.0 + bounds.size.width - offset.width; ! tmp.size.height = 2.0 - offset.height; ! [m_pWin setNeedsDisplayInRect:tmp]; ! bounds.size.width = offset.width; ! } ! } ! else ! { ! bounds.size.width = offset.width; ! } ! } ! } ! else if (offset.width < 0) ! { ! if ((-offset.width) < bounds.size.width) ! { ! if (offset.height > 0) ! { ! if (offset.height < bounds.size.height) ! { ! NSRect tmp; ! tmp.origin.x = -1.0 + bounds.origin.x; ! tmp.origin.y = -1.0 + bounds.origin.y; ! tmp.size.width = 2.0 + bounds.size.width - offset.width; ! tmp.size.height = 2.0 + offset.height; ! [m_pWin setNeedsDisplayInRect:tmp]; ! ! bounds.origin.x += bounds.size.width + offset.width; ! bounds.size.width = -offset.width; ! } ! } ! else if (offset.height < 0) ! { ! if ((-offset.height) < bounds.size.height) ! { ! NSRect tmp; ! tmp.origin.x = -1.0 + bounds.origin.x; ! tmp.origin.y = -1.0 + bounds.origin.y + bounds.size.height + offset.height; ! tmp.size.width = 2.0 + bounds.size.width + offset.width; ! tmp.size.height = 2.0 - offset.height; ! [m_pWin setNeedsDisplayInRect:tmp]; ! ! bounds.origin.x += bounds.size.width + offset.width; ! bounds.size.width = -offset.width; ! } ! } ! else ! { ! bounds.origin.x += bounds.size.width + offset.width; ! bounds.size.width = -offset.width; ! } ! } ! } ! else ! { ! if (offset.height > 0) ! { ! if (offset.height < bounds.size.height) ! { ! bounds.size.height = offset.height; ! } ! } ! else if (offset.height < 0) ! { ! if ((-offset.height) < bounds.size.height) ! { ! bounds.origin.y += bounds.size.height + offset.height; ! bounds.size.height = -offset.height; ! } ! } ! } ! bounds.origin.x += -1.0; ! bounds.origin.y += -1.0; ! bounds.size.width += 2.0; ! bounds.size.height += 2.0; ! [m_pWin setNeedsDisplayInRect:bounds]; if (pC) pC->enable (); } --- 778,804 ---- * there can be a sizeable discrepancy (in local units) between the scroll that was requested and the * reported exposed area. I am therefore marking an extra 1-pixel border around the exposed display area. */ ! /* This is a temporary special case to handle the fact that FV_View::setYScrollOffset doesn't call draw unlike it's horizontal counterpart and ! the scroll functions of the rulers.*/ ! if ( bounds.size.width != 32 ) //if not the ruler ! { ! NSRect tmp; ! tmp.origin.x = -1.0 + bounds.origin.x; ! tmp.size.width = 2.0 + bounds.size.width; ! if (ddy > 0 ) ! { ! tmp.size.height = 2.0 + offset.height; ! tmp.origin.y = -1.0 + bounds.origin.y; ! } ! else ! { ! tmp.size.height = 2.0 - offset.height; ! tmp.origin.y = -1.0 + bounds.origin.y + bounds.size.height + offset.height; ! } ! [m_pWin setNeedsDisplayInRect:tmp]; ! } if (pC) pC->enable (); } *************** *** 888,900 **** UT_sint32 x_src, UT_sint32 y_src, UT_sint32 width, UT_sint32 height) { ! UT_sint32 dx, dy; ! dx = tdu(x_src - x_dest); ! dy = tdu(y_src - y_dest); printf ("scrollrect: %f %f %f %f -> %d %d\n", (float)tdu(x_src), (float)tdu(y_src), (float)tdu(width), (float)tdu(height), -dx, dy); ! [m_pWin scrollRect:NSMakeRect(tduD(x_src), tduD(y_src), tduD(width), tduD(height)) ! by:NSMakeSize(-dx,dy)]; } void GR_CocoaGraphics::clearArea(UT_sint32 x, UT_sint32 y, --- 807,830 ---- UT_sint32 x_src, UT_sint32 y_src, UT_sint32 width, UT_sint32 height) { ! ! UT_sint32 dx, dy; ! dx = x_src - x_dest; ! dy = y_src - y_dest; ! ! UT_sint32 oldDY = tdu(getPrevYOffset()); ! UT_sint32 oldDX = tdu(getPrevXOffset()); ! UT_sint32 newY = getPrevYOffset() + dy; ! UT_sint32 newX = getPrevXOffset() + dx; ! UT_sint32 ddx = -(tdu(newX) - oldDX); ! UT_sint32 ddy = -(tdu(newY) - oldDY); ! setPrevYOffset(newY); ! setPrevXOffset(newX); ! printf ("scrollrect: %f %f %f %f -> %d %d\n", (float)tdu(x_src), (float)tdu(y_src), (float)tdu(width), (float)tdu(height), -dx, dy); ! [m_pWin scrollRect:NSMakeRect(tdu(x_src), tdu(y_src), tdu(width), tdu(height)) ! by:NSMakeSize(ddx,ddy)]; } void GR_CocoaGraphics::clearArea(UT_sint32 x, UT_sint32 y,