- // Microsoft's rect-coordinates are best suited
- // for the case of corner-clipping
-
- int left = mInitialRect.x;
- int top = mInitialRect.y;
- int right = mInitialRect.x + mInitialRect.width;
- int bottom = mInitialRect.y + mInitialRect.height;
-
- // constraint delta edge is dragged
-
- switch ( mCursorType )
- {
- case HITS_WND_LEFT_EDGE : delta.y = 0; break;
- case HITS_WND_RIGHT_EDGE : delta.y = 0; break;
- case HITS_WND_TOP_EDGE : delta.x = 0; break;
- case HITS_WND_BOTTOM_EDGE : delta.x = 0; break;
- default: break;
- }
-
- if ( mCursorType == HITS_WND_TOP_EDGE ||
- mCursorType == HITS_WND_TOP_LEFT_CORNER )
- {
- left += delta.x;
- top += delta.y;
-
- clip_to( left, -INFINITY, mInitialRect.x + mInitialRect.width - minDim.x );
- clip_to( top, -INFINITY, mInitialRect.y + mInitialRect.height - minDim.y );
- }
- else
- if ( mCursorType == HITS_WND_LEFT_EDGE ||
- mCursorType == HITS_WND_BOTTOM_LEFT_CORNER )
- {
- left += delta.x;
- bottom += delta.y;
-
- clip_to( left, -INFINITY, mInitialRect.x + mInitialRect.width - minDim.x );
- clip_to( bottom, mInitialRect.y + minDim.y, INFINITY );
- }
- else
- if ( mCursorType == HITS_WND_RIGHT_EDGE ||
- mCursorType == HITS_WND_TOP_RIGHT_CORNER )
- {
- right += delta.x;
- top += delta.y;
-
- clip_to( right, mInitialRect.x + minDim.x, INFINITY );
- clip_to( top, -INFINITY, mInitialRect.y + mInitialRect.height - minDim.y );
- }
- else
- if ( mCursorType == HITS_WND_BOTTOM_EDGE ||
- mCursorType == HITS_WND_BOTTOM_RIGHT_CORNER )
- {
- right += delta.x;
- bottom += delta.y;
-
- clip_to( right, mInitialRect.x + minDim.x, INFINITY );
- clip_to( bottom, mInitialRect.y + minDim.y, INFINITY );
- }
- else
- {
- wxFAIL( _T("what did the cursor hit?") );
- }
-
- rect.x = left;
- rect.y = top;
- rect.width = right - left;
- rect.height = bottom - top;
+ // Microsoft's rect-coordinates are best suited
+ // for the case of corner-clipping
+
+ int left = mInitialRect.x;
+ int top = mInitialRect.y;
+ int right = mInitialRect.x + mInitialRect.width;
+ int bottom = mInitialRect.y + mInitialRect.height;
+
+ // constraint delta edge is dragged
+
+ switch ( mCursorType )
+ {
+ case HITS_WND_LEFT_EDGE : delta.y = 0; break;
+ case HITS_WND_RIGHT_EDGE : delta.y = 0; break;
+ case HITS_WND_TOP_EDGE : delta.x = 0; break;
+ case HITS_WND_BOTTOM_EDGE : delta.x = 0; break;
+ default: break;
+ }
+
+ if ( mCursorType == HITS_WND_TOP_EDGE ||
+ mCursorType == HITS_WND_TOP_LEFT_CORNER )
+ {
+ left += delta.x;
+ top += delta.y;
+
+ clip_to( left, -FL_INFINITY, mInitialRect.x + mInitialRect.width - minDim.x );
+ clip_to( top, -FL_INFINITY, mInitialRect.y + mInitialRect.height - minDim.y );
+ }
+ else
+ if ( mCursorType == HITS_WND_LEFT_EDGE ||
+ mCursorType == HITS_WND_BOTTOM_LEFT_CORNER )
+ {
+ left += delta.x;
+ bottom += delta.y;
+
+ clip_to( left, -FL_INFINITY, mInitialRect.x + mInitialRect.width - minDim.x );
+ clip_to( bottom, mInitialRect.y + minDim.y, FL_INFINITY );
+ }
+ else
+ if ( mCursorType == HITS_WND_RIGHT_EDGE ||
+ mCursorType == HITS_WND_TOP_RIGHT_CORNER )
+ {
+ right += delta.x;
+ top += delta.y;
+
+ clip_to( right, mInitialRect.x + minDim.x, FL_INFINITY );
+ clip_to( top, -FL_INFINITY, mInitialRect.y + mInitialRect.height - minDim.y );
+ }
+ else
+ if ( mCursorType == HITS_WND_BOTTOM_EDGE ||
+ mCursorType == HITS_WND_BOTTOM_RIGHT_CORNER )
+ {
+ right += delta.x;
+ bottom += delta.y;
+
+ clip_to( right, mInitialRect.x + minDim.x, FL_INFINITY );
+ clip_to( bottom, mInitialRect.y + minDim.y, FL_INFINITY );
+ }
+ else
+ {
+ wxFAIL_MSG( _T("what did the cursor hit?") );
+ }
+
+ rect.x = left;
+ rect.y = top;
+ rect.width = right - left;
+ rect.height = bottom - top;