ServerPicture was using the wrong StrokeRect call (the one which ignored

the pen size). Added scale handling. Removed duplicated AS_SETPENSIZE 
handler in ServerWindow


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19130 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2006-10-26 19:49:02 +00:00
parent 8cafa544f6
commit 0e683ed9aa
2 changed files with 17 additions and 13 deletions

View File

@ -42,7 +42,7 @@ stroke_line(ViewLayer *view, BPoint start, BPoint end)
{
view->ConvertToScreenForDrawing(&start);
view->ConvertToScreenForDrawing(&end);
view->Window()->GetDrawingEngine()->StrokeLine(start, end, view->CurrentState()->HighColor());
view->Window()->GetDrawingEngine()->StrokeLine(start, end, view->CurrentState());
}
@ -50,7 +50,7 @@ static void
stroke_rect(ViewLayer *view, BRect rect)
{
view->ConvertToScreenForDrawing(&rect);
view->Window()->GetDrawingEngine()->StrokeRect(rect, view->CurrentState()->HighColor());
view->Window()->GetDrawingEngine()->StrokeRect(rect, view->CurrentState());
}
@ -58,7 +58,7 @@ static void
fill_rect(ViewLayer *view, BRect rect)
{
view->ConvertToScreenForDrawing(&rect);
view->Window()->GetDrawingEngine()->FillRect(rect, view->CurrentState()->HighColor());
view->Window()->GetDrawingEngine()->FillRect(rect, view->CurrentState());
}
@ -669,6 +669,10 @@ ServerPicture::SyncState(ViewLayer *view)
AddFloat(view->CurrentState()->PenSize());
EndOp();
BeginOp(B_PIC_SET_SCALE);
AddFloat(view->CurrentState()->Scale());
EndOp();
BeginOp(B_PIC_SET_LINE_MODE);
AddInt16((int16)view->CurrentState()->LineCapMode());
AddInt16((int16)view->CurrentState()->LineJoinMode());

View File

@ -1809,16 +1809,6 @@ ServerWindow::_DispatchViewMessage(int32 code,
fCurrentLayer->CurrentState()->SetPenLocation(BPoint(x, y));
break;
}
case AS_SETPENSIZE:
{
DTRACE(("ServerWindow %s: Message AS_SETPENSIZE\n", Title()));
float size;
link.Read<float>(&size);
fCurrentLayer->CurrentState()->SetPenSize(size);
break;
}
case AS_SET_FONT:
{
DTRACE(("ServerWindow %s: Message AS_SET_FONT\n", Title()));
@ -2387,6 +2377,16 @@ ServerWindow::_DispatchPictureMessage(int32 code, BPrivate::LinkReceiver &link)
break;
}
case AS_LAYER_SET_SCALE:
{
float scale;
link.Read<float>(&scale);
picture->BeginOp(B_PIC_SET_SCALE);
picture->AddFloat(scale);
picture->EndOp();
break;
}
case AS_FILL_RECT:
case AS_STROKE_RECT:
{