| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../include/fxedit/fxet_stub.h" | 7 #include "../../include/fxedit/fxet_stub.h" |
| 8 #include "../../include/fxedit/fx_edit.h" | 8 #include "../../include/fxedit/fx_edit.h" |
| 9 #include "../../include/fxedit/fxet_edit.h" | 9 #include "../../include/fxedit/fxet_edit.h" |
| 10 | 10 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 { | 390 { |
| 391 DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffs
et.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), | 391 DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffs
et.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), |
| 392 wp.fFontSize, pUser2Device, sTextBuf.Get
ByteString(), crOld, 0, wp.nHorzScale); | 392 wp.fFontSize, pUser2Device, sTextBuf.Get
ByteString(), crOld, 0, wp.nHorzScale); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 | 396 |
| 397 pDevice->RestoreState(); | 397 pDevice->RestoreState(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 static void AddLineToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crStro
ke, | |
| 401 const CPDF_Poin
t& pt1, const CPDF_Point& pt2) | |
| 402 { | |
| 403 CPDF_PathObject* pPathObj = new CPDF_PathObject; | |
| 404 CPDF_PathData* pPathData = pPathObj->m_Path.GetModify(); | |
| 405 | |
| 406 pPathData->SetPointCount(2); | |
| 407 pPathData->SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO); | |
| 408 pPathData->SetPoint(1, pt2.x, pt2.y, FXPT_LINETO); | |
| 409 | |
| 410 FX_FLOAT rgb[3]; | |
| 411 rgb[0] = FXARGB_R(crStroke) / 255.0f; | |
| 412 rgb[1] = FXARGB_G(crStroke) / 255.0f; | |
| 413 rgb[2] = FXARGB_B(crStroke) / 255.0f; | |
| 414 pPathObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_
DEVICERGB), rgb, 3); | |
| 415 | |
| 416 CFX_GraphStateData* pData = pPathObj->m_GraphState.GetModify(); | |
| 417 pData->m_LineWidth = 1; | |
| 418 | |
| 419 pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj); | |
| 420 } | |
| 421 | |
| 422 static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill
, const CPDF_Rect& rcFill) | 400 static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill
, const CPDF_Rect& rcFill) |
| 423 { | 401 { |
| 424 CPDF_PathObject* pPathObj = new CPDF_PathObject; | 402 CPDF_PathObject* pPathObj = new CPDF_PathObject; |
| 425 CPDF_PathData* pPathData = pPathObj->m_Path.GetModify(); | 403 CPDF_PathData* pPathData = pPathObj->m_Path.GetModify(); |
| 426 pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top)
; | 404 pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top)
; |
| 427 | 405 |
| 428 FX_FLOAT rgb[3]; | 406 FX_FLOAT rgb[3]; |
| 429 rgb[0] = FXARGB_R(crFill) / 255.0f ; | 407 rgb[0] = FXARGB_R(crFill) / 255.0f ; |
| 430 rgb[1] = FXARGB_G(crFill) / 255.0f; | 408 rgb[1] = FXARGB_G(crFill) / 255.0f; |
| 431 rgb[2] = FXARGB_B(crFill) / 255.0f; | 409 rgb[2] = FXARGB_B(crFill) / 255.0f; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 rcUnderline.right += ptOffset.x; | 632 rcUnderline.right += ptOffset.x; |
| 655 rcUnderline.top += ptOffset.y; | 633 rcUnderline.top += ptOffset.y; |
| 656 rcUnderline.bottom += ptOffset.y; | 634 rcUnderline.bottom += ptOffset.y; |
| 657 AddRectToPageObjects(pPageObjects, color
, rcUnderline); | 635 AddRectToPageObjects(pPageObjects, color
, rcUnderline); |
| 658 } | 636 } |
| 659 } | 637 } |
| 660 } | 638 } |
| 661 } | 639 } |
| 662 } | 640 } |
| 663 | 641 |
| OLD | NEW |