Ejemplo n.º 1
0
void NodeBrush::RenderObjectBlobs(RenderRegion* pRegion)
{
#if !defined(EXCLUDE_FROM_RALPH)
    // Find out about the groups bounding rect
    DocRect BoundingRect = GetBoundingRect();

    // Inflate the bounds by the width of a blob
    DocRect TempRect;
    GetApplication()->GetBlobManager()->GetBlobRect(BoundingRect.lo,&TempRect);
    INT32 Delta = ((TempRect.hi.x - TempRect.lo.x)*3)/4;
    BoundingRect.Inflate(Delta);

    // Find out where to draw the blobs
    DocCoord Low  = BoundingRect.LowCorner();
    DocCoord High = BoundingRect.HighCorner();

    // Set the colours of the blobs
    pRegion->SetFillColour(COLOUR_UNSELECTEDBLOB);
    pRegion->SetLineColour(COLOUR_NONE);

    // Draw all the blobs
    pRegion->DrawBlob(Low, BT_UNSELECTED);
    pRegion->DrawBlob(High, BT_UNSELECTED);
    pRegion->DrawBlob(DocCoord(Low.x, High.y), BT_UNSELECTED);
    pRegion->DrawBlob(DocCoord(High.x, Low.y), BT_UNSELECTED);

    // for some reason the NBP is never called, there is probably a
    // proper fix for this but I don't have time right now, so render
    // the nodeblend path here
    m_pNodeBrushPath->RenderObjectBlobs(pRegion);


#endif
}
Ejemplo n.º 2
0
Chapter* DocCoord::FindEnclosingChapter(Document *pDocument, 
										DocCoord* ChapterPos, 
										XLONG* ChapterDepth,
										View *pView)
{
	Chapter* CurrentChapter = Node::FindFirstChapter(pDocument);
	// Search all chapters
	*ChapterDepth = 0;
	DocRect CurrentChaptersPasteboardRect;

	while (CurrentChapter != NULL)
	{
		CurrentChaptersPasteboardRect = CurrentChapter->GetPasteboardRect(TRUE, pView);

		if (CurrentChaptersPasteboardRect.ContainsRectCoord(*this))
		{
			// Chapter position is the top left hand corner of the chapters pasteboard
			ChapterPos->x = CurrentChaptersPasteboardRect.LowCorner().x;
			ChapterPos->y = CurrentChaptersPasteboardRect.HighCorner().y;
			return (CurrentChapter);
		}

        (*ChapterDepth) += CurrentChaptersPasteboardRect.Height();
		CurrentChapter = CurrentChapter->FindNextChapter();
    }

	// The DocCoord was not found in any chapter
	ERROR3("DocCoord::FindEnclosingChapter: Coord wasn't in any chapter. See the function help for debugging tips");
	return(NULL);
}