* push the states on the server instead on the client side
* DrawState::SetOrigin needs to take the view scaling into account
* set the orgin in BPrintJob, to be able to print more then one page properly
Note: This would make printing work on HAIKU as on BeOS, but still it does
not because of 1; BPortLink size limit and 2; because we can only print/ draw
the visible region of a view? I had to resize StyledEdit to a i.e 10000
to test and to be able to print the full syslog.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24682 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -531,7 +531,7 @@ BPrintJob::DrawView(BView *view, BRect rect, BPoint where)
|
|||||||
|
|
||||||
if (view->LockLooper()) {
|
if (view->LockLooper()) {
|
||||||
BPicture picture;
|
BPicture picture;
|
||||||
_RecurseView(view, where, &picture, rect);
|
_RecurseView(view, B_ORIGIN - rect.LeftTop(), &picture, rect);
|
||||||
_AddPicture(picture, rect, where);
|
_AddPicture(picture, rect, where);
|
||||||
view->UnlockLooper();
|
view->UnlockLooper();
|
||||||
}
|
}
|
||||||
@@ -664,6 +664,7 @@ BPrintJob::_RecurseView(BView *view, BPoint origin,
|
|||||||
view->AppendToPicture(picture);
|
view->AppendToPicture(picture);
|
||||||
view->f_is_printing = true;
|
view->f_is_printing = true;
|
||||||
view->PushState();
|
view->PushState();
|
||||||
|
view->SetOrigin(origin);
|
||||||
view->Draw(rect);
|
view->Draw(rect);
|
||||||
view->PopState();
|
view->PopState();
|
||||||
view->f_is_printing = false;
|
view->f_is_printing = false;
|
||||||
|
|||||||
@@ -283,10 +283,15 @@ DrawState::SetOrigin(const BPoint& origin)
|
|||||||
|
|
||||||
// NOTE: the origins of earlier states are never expected to
|
// NOTE: the origins of earlier states are never expected to
|
||||||
// change, only the topmost state ever changes
|
// change, only the topmost state ever changes
|
||||||
if (fPreviousState)
|
if (fPreviousState) {
|
||||||
fCombinedOrigin = fPreviousState->fCombinedOrigin + fOrigin;
|
fCombinedOrigin.x = fPreviousState->fCombinedOrigin.x
|
||||||
else
|
+ fOrigin.x * fPreviousState->fCombinedScale;
|
||||||
fCombinedOrigin = fOrigin;
|
fCombinedOrigin.y = fPreviousState->fCombinedOrigin.y
|
||||||
|
+ fOrigin.y * fPreviousState->fCombinedScale;
|
||||||
|
} else {
|
||||||
|
fCombinedOrigin.x = fOrigin.x * fCombinedScale;
|
||||||
|
fCombinedOrigin.y = fOrigin.y * fCombinedScale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2364,8 +2364,12 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code, BPrivate::LinkReceiver &li
|
|||||||
|
|
||||||
ServerPicture *picture = App()->FindPicture(token);
|
ServerPicture *picture = App()->FindPicture(token);
|
||||||
if (picture != NULL) {
|
if (picture != NULL) {
|
||||||
fCurrentView->CurrentState()->SetOrigin(where);
|
fCurrentView->PushState();
|
||||||
|
fCurrentView->SetDrawingOrigin(where);
|
||||||
|
fCurrentView->PushState();
|
||||||
picture->Play(fCurrentView);
|
picture->Play(fCurrentView);
|
||||||
|
fCurrentView->PopState();
|
||||||
|
fCurrentView->PopState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user