diff --git a/src/servers/app/server/DefaultDecorator.cpp b/src/servers/app/server/DefaultDecorator.cpp index 81f8821e3d..e932a733cd 100644 --- a/src/servers/app/server/DefaultDecorator.cpp +++ b/src/servers/app/server/DefaultDecorator.cpp @@ -473,8 +473,10 @@ void DefaultDecorator::_DrawFrame(BRect invalid) // For quick calculation of gradients for each side. Top is same as left, right is same as // bottom - int8 rightindices[borderwidth],leftindices[borderwidth]; - +// int8 rightindices[borderwidth],leftindices[borderwidth]; + int8 *rightindices=new int8[borderwidth], + *leftindices=new int8[borderwidth]; + if(borderwidth==5) { leftindices[0]=2; @@ -494,31 +496,37 @@ void DefaultDecorator::_DrawFrame(BRect invalid) // TODO: figure out border colors for floating window look } + // Variables used in each calculation + int32 startx,endx,starty,endy,i; + bool topcorner,bottomcorner,leftcorner,rightcorner; + int8 step,colorindex; + BRect r; + BPoint start, end; + // Right side if(TestRectIntersection(rightborder,invalid)) { // We may not have to redraw the entire width of the frame itself. Rare case, but // it must be accounted for. - int32 startx=(int32) MAX(invalid.left,rightborder.left); - int32 endx=(int32) MIN(invalid.right,rightborder.right); - + startx=(int32) MAX(invalid.left,rightborder.left); + endx=(int32) MIN(invalid.right,rightborder.right); // We'll need these flags to see if we must include the corners in final line // calculations - BRect r(rightborder); + r=(rightborder); r.bottom=r.top+borderwidth; - bool topcorner=TestRectIntersection(invalid,r); + topcorner=TestRectIntersection(invalid,r); r=rightborder; r.top=r.bottom-borderwidth; - bool bottomcorner=TestRectIntersection(invalid,r); + bottomcorner=TestRectIntersection(invalid,r); + step=(borderwidth==5)?1:2; + colorindex=0; // Generate the lines for this side - for(int32 i=startx; iStrokeLineArray(points,numlines,colors,&_layerdata); -/* BRect r=_borderrect; - - _layerdata.highcolor=framecolors[2]; - _driver->StrokeLine(BPoint(r.left,r.top),BPoint(r.right-1,r.top), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[3]; - _driver->StrokeLine(BPoint(r.left,r.top),BPoint(r.left,r.bottom), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[4]; - _driver->StrokeLine(BPoint(r.right,r.bottom),BPoint(r.right,r.top), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[4]; - _driver->StrokeLine(BPoint(r.right,r.bottom),BPoint(r.left,r.bottom), - &_layerdata,(int8*)&solidhigh); - - r.InsetBy(1,1); - _layerdata.highcolor=framecolors[0]; - _driver->StrokeLine(BPoint(r.left,r.top),BPoint(r.right-1,r.top), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[0]; - _driver->StrokeLine(BPoint(r.left,r.top),BPoint(r.left,r.bottom), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[2]; - _driver->StrokeLine(BPoint(r.right,r.bottom),BPoint(r.right,r.top), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[2]; - _driver->StrokeLine(BPoint(r.right,r.bottom),BPoint(r.left,r.bottom), - &_layerdata,(int8*)&solidhigh); + delete rightindices; + delete leftindices; - r.InsetBy(1,1); - _layerdata.highcolor=framecolors[1]; - _driver->StrokeRect(r,&_layerdata,(int8*)&solidhigh); - - r.InsetBy(1,1); - _layerdata.highcolor=framecolors[4]; - _driver->StrokeLine(BPoint(r.left,r.top),BPoint(r.right-1,r.top), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[4]; - _driver->StrokeLine(BPoint(r.left,r.top),BPoint(r.left,r.bottom), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[0]; - _driver->StrokeLine(BPoint(r.right,r.bottom),BPoint(r.right,r.top), - &_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=framecolors[0]; - _driver->StrokeLine(BPoint(r.right,r.bottom),BPoint(r.left,r.bottom), - &_layerdata,(int8*)&solidhigh); - _driver->StrokeRect(_borderrect,&_layerdata,(int8*)&solidhigh); - - - // Draw the resize thumb if we're supposed to +/* // Draw the resize thumb if we're supposed to if(!(_flags & B_NOT_RESIZABLE)) { r=_resizerect; diff --git a/src/servers/app/server/ViewDriver.cpp b/src/servers/app/server/ViewDriver.cpp index 9b30a48aa6..cb595a857a 100644 --- a/src/servers/app/server/ViewDriver.cpp +++ b/src/servers/app/server/ViewDriver.cpp @@ -1053,15 +1053,12 @@ void ViewDriver::StrokeLineArray(BPoint *pts, int32 numlines, RGBColor *colors, // screenwin->view->Invalidate(); // for now, just print the data and hope we don't crash - printf("ViewDriver::StrokeLineArray(): \n"); - BPoint *ptindex=pts; + int32 ptindex=0; for(int32 i=0; iSetHighColor(col);