fix it so that we still get default drag rectangle when there is no region passed in.

This commit is contained in:
pinkerton%netscape.com 1999-09-02 06:52:54 +00:00
Родитель 6ef6ed8924
Коммит c058cf9f7e
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -133,18 +133,16 @@ nsDragService :: InvokeDragSession (nsISupportsArray * aTransferableArray, nsISc
void
nsDragService :: BuildDragRegion ( nsIScriptableRegion* inRegion, Point inGlobalMouseLoc, RgnHandle ioDragRgn )
{
nsCOMPtr<nsIRegion> holder ( do_QueryInterface(inRegion) );
if ( !holder )
return;
nsCOMPtr<nsIRegion> geckoRegion ( do_QueryInterface(inRegion) );
// create the drag region. Pull out the native mac region from the nsIRegion we're
// given, copy it, inset it one pixel, and subtract them so we're left with just an
// outline. Too bad we can't do this with gfx api's.
//
// At the end, we are left with an outline of the region in global coordinates.
if ( inRegion ) {
if ( geckoRegion ) {
RgnHandle dragRegion = nsnull;
holder->GetNativeRegion(dragRegion);
geckoRegion->GetNativeRegion(dragRegion);
if ( dragRegion && ioDragRgn ) {
::CopyRgn ( dragRegion, ioDragRgn );
::InsetRgn ( ioDragRgn, 1, 1 );