From 6f70fc00b6ffdd6a6aa704901646b71ca55322f5 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Sat, 16 Oct 2004 01:58:03 +0000 Subject: [PATCH] Updated to match the change to DisplayDriver::StrokeLineArray git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9375 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../decorators/BeDecorator/BeDecorator.cpp | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp index 306cbc4a35..3039a5d97a 100644 --- a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp +++ b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp @@ -519,9 +519,8 @@ void BeDecorator::_DrawFrame(BRect invalid) // Data specifically for the StrokeLineArray call. int32 numlines=0, maxlines=20; - - BPoint points[maxlines*2]; - RGBColor colors[maxlines]; + + LineArrayData linedata[maxlines], *currentdata; // For quick calculation of gradients for each side. Top is same as left, right is same as // bottom @@ -609,9 +608,10 @@ void BeDecorator::_DrawFrame(BRect invalid) end.y=MIN(end.y-borderwidth,invalid.bottom); // Make the appropriate - points[numlines*2]=start; - points[(numlines*2)+1]=end; - colors[numlines]=framecolors[rightindices[colorindex]]; + currentdata=&(linedata[numlines]); + currentdata->pt1=start; + currentdata->pt2=end; + currentdata->color=framecolors[rightindices[colorindex]].GetColor32(); colorindex+=step; numlines++; } @@ -660,9 +660,10 @@ void BeDecorator::_DrawFrame(BRect invalid) end.y=MIN(end.y-borderwidth,invalid.bottom); // Make the appropriate - points[numlines*2]=start; - points[(numlines*2)+1]=end; - colors[numlines]=framecolors[leftindices[colorindex]]; + currentdata=&(linedata[numlines]); + currentdata->pt1=start; + currentdata->pt2=end; + currentdata->color=framecolors[leftindices[colorindex]].GetColor32(); colorindex+=step; numlines++; } @@ -714,11 +715,12 @@ void BeDecorator::_DrawFrame(BRect invalid) end.x=MIN(end.x-borderwidth,invalid.right); // Make the appropriate - points[numlines*2]=start; - points[(numlines*2)+1]=end; + currentdata=&(linedata[numlines]); + currentdata->pt1=start; + currentdata->pt2=end; // Top side uses the same color order as the left one - colors[numlines]=framecolors[leftindices[colorindex]]; + currentdata->color=framecolors[leftindices[colorindex]].GetColor32(); colorindex+=step; numlines++; } @@ -770,20 +772,21 @@ void BeDecorator::_DrawFrame(BRect invalid) end.x=MIN(end.x-borderwidth,invalid.right); // Make the appropriate - points[numlines*2]=start; - points[(numlines*2)+1]=end; + currentdata=&(linedata[numlines]); + currentdata->pt1=start; + currentdata->pt2=end; - // Top side uses the same color order as the left one - colors[numlines]=framecolors[rightindices[colorindex]]; + // Top side uses the same color order as the right one + currentdata->color=framecolors[rightindices[colorindex]].GetColor32(); colorindex+=step; numlines++; } } - _driver->StrokeLineArray(points,numlines,&_drawdata,colors); + _driver->StrokeLineArray(numlines,linedata,&_drawdata); - delete rightindices; - delete leftindices; + delete [] rightindices; + delete [] leftindices; // Draw the resize thumb if we're supposed to if(!(_flags & B_NOT_RESIZABLE))