Problem: 1615653
Title: (TView::RestrictRegionToVisible) wrong cursor and help regions
Received: Dec 27 1996 11:46AM
You can easily reproduce the bug using the Calc example program. After resizing a column in Calc, the cursor changes to an arrow altough it should be the horizontal resize cursor. The problem is that Calc invalidates the view after resizing the columns and MacApp tries to calculate a cursor region before the update-event has been processed. Since the invalidated view gets accumulated into the clipping-region, TView::RestrictRegionToVisible changes the calculated cursor region to be empty which leads to MacApp's default-behavior of using the arrow-cursor. One solution is to simply stop TView::RestrictRegionToVisible from using the clipping region by disabling the SectRgn call:
void TView::RestrictRegionToVisible(RgnHandle aRegion) { #if qDebug this->AssumeFocused(); #endif CRect itsVisibleExtent; this->ViewToQDRect(this->GetVisibleExtent(), itsVisibleExtent); CTemporaryRegion visibleExtentRgn; RectRgn(visibleExtentRgn, itsVisibleExtent); SectRgn(aRegion, visibleExtentRgn, aRegion); // Intersect with visible region SectRgn(GetVisRegion(qd.thePort), aRegion, aRegion); // !!! BUG-FIX !!! Cursor-regions should not be limited // !!! BUG-FIX !!! by clip-region (invalidation) // SectRgn(GetClipRegion(qd.thePort), aRegion, aRegion); } // TView::RestrictRegionToVisibleAnother solution might be to defer the calculation of cursor-regions until pending update-events have been processed.
Implemented the suggestion. Verified using Calc, resizing a column.