FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { ASSERT(pPageView != NULL); ASSERT(pAnnot != NULL); CPDF_Rect rcAnnot = m_pWidget->GetRect(); if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { CPDF_Rect rcWindow = pWnd->GetWindowRect(); rcAnnot = PWLtoFFL(rcWindow); } CPDF_Rect rcWin = rcAnnot; CPDF_Rect rcFocus = GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) rcWin.Union(rcFocus); CPDF_Rect rect = CPWL_Utils::InflateRect(rcWin, 1); return rect.GetOutterRect(); }
void CFFL_IFormFiller::OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow) { ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; if (CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, TRUE)) { CPDF_Rect rcOld = pFormFiller->PWLtoFFL(pFormFiller->GetWindowRect(pData->pPageView)); CPDF_Rect rcNew = pFormFiller->PWLtoFFL(rcWindow); pFormFiller->SetWindowRect(pData->pPageView, rcWindow); CPDF_Rect unRect = rcOld; unRect.Union(rcNew); //FX_RECT rcRect = unRect.GetOutterRect(); unRect.left = (FX_FLOAT)(unRect.left - 0.5); unRect.right = (FX_FLOAT)(unRect.right + 0.5); unRect.top = (FX_FLOAT)(unRect.top + 0.5); unRect.bottom = (FX_FLOAT)(unRect.bottom -0.5); m_pApp->FFI_Invalidate(pData->pWidget->GetPDFPage(), unRect.left, unRect.top, unRect.right, unRect.bottom); } }