* maintain our own rect while printing, this makes it possible to print all pages e.g. syslog from StyledEdit
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26304 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -101,6 +101,9 @@ class ViewState {
|
||||
uint32 valid_flags;
|
||||
// flags used for archiving
|
||||
uint32 archiving_flags;
|
||||
|
||||
// maintain our own rect as seen from the app while printing
|
||||
BRect print_rect;
|
||||
};
|
||||
|
||||
inline bool
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
|
||||
#include <pr_server.h>
|
||||
#include <ViewPrivate.h>
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -506,9 +507,9 @@ BPrintJob::_RecurseView(BView *view, BPoint origin, BPicture *picture,
|
||||
|
||||
BRegion region;
|
||||
region.Set(BRect(rect.left, rect.top, rect.right, rect.bottom));
|
||||
view->fState->print_rect = rect;
|
||||
|
||||
view->AppendToPicture(picture);
|
||||
view->fIsPrinting = true;
|
||||
view->PushState();
|
||||
view->SetOrigin(origin);
|
||||
view->ConstrainClippingRegion(®ion);
|
||||
@@ -520,9 +521,11 @@ BPrintJob::_RecurseView(BView *view, BPoint origin, BPicture *picture,
|
||||
view->SetHighColor(highColor);
|
||||
}
|
||||
|
||||
view->fIsPrinting = true;
|
||||
view->Draw(rect);
|
||||
view->PopState();
|
||||
view->fIsPrinting = false;
|
||||
|
||||
view->PopState();
|
||||
view->EndPicture();
|
||||
|
||||
BView *child = view->ChildAt(0);
|
||||
@@ -538,13 +541,13 @@ BPrintJob::_RecurseView(BView *view, BPoint origin, BPicture *picture,
|
||||
|
||||
if (view->Flags() & B_DRAW_ON_CHILDREN) {
|
||||
view->AppendToPicture(picture);
|
||||
view->fIsPrinting = true;
|
||||
view->PushState();
|
||||
view->SetOrigin(origin);
|
||||
view->ConstrainClippingRegion(®ion);
|
||||
view->fIsPrinting = true;
|
||||
view->DrawAfterChildren(rect);
|
||||
view->PopState();
|
||||
view->fIsPrinting = false;
|
||||
view->PopState();
|
||||
view->EndPicture();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,6 +639,9 @@ BView::Bounds() const
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (fIsPrinting)
|
||||
return fState->print_rect;
|
||||
|
||||
return fBounds;
|
||||
}
|
||||
|
||||
@@ -2286,7 +2289,13 @@ BView::GetClippingRegion(BRegion* region) const
|
||||
// changed, so it is always read from the server
|
||||
region->MakeEmpty();
|
||||
|
||||
|
||||
if (fOwner) {
|
||||
if (fIsPrinting && _CheckOwnerLock()) {
|
||||
region->Set(fState->print_rect);
|
||||
return;
|
||||
}
|
||||
|
||||
_CheckLockAndSwitchCurrent();
|
||||
fOwner->fLink->StartMessage(AS_VIEW_GET_CLIP_REGION);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user