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 "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" |
8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" | 8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" |
11 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" | 11 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
12 #include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" | 12 #include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" |
13 #include "core/fpdfdoc/include/cpvt_word.h" | 13 #include "core/fpdfdoc/include/cpvt_word.h" |
14 #include "core/fpdfdoc/include/ipvt_fontmap.h" | 14 #include "core/fpdfdoc/include/ipvt_fontmap.h" |
15 #include "core/fxge/include/fx_ge.h" | 15 #include "core/fxge/include/fx_ge.h" |
16 #include "fpdfsdk/cfx_systemhandler.h" | 16 #include "fpdfsdk/cfx_systemhandler.h" |
17 #include "fpdfsdk/fxedit/include/fx_edit.h" | 17 #include "fpdfsdk/fxedit/include/fx_edit.h" |
18 #include "fpdfsdk/fxedit/include/fxet_edit.h" | 18 #include "fpdfsdk/fxedit/include/fxet_edit.h" |
19 | 19 |
20 #define FX_EDIT_UNDERLINEHALFWIDTH 0.5f | |
21 #define FX_EDIT_CROSSOUTHALFWIDTH 0.5f | |
22 | |
23 CFX_FloatRect GetUnderLineRect(const CPVT_Word& word) { | 20 CFX_FloatRect GetUnderLineRect(const CPVT_Word& word) { |
24 return CFX_FloatRect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f, | 21 return CFX_FloatRect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f, |
25 word.ptWord.x + word.fWidth, | 22 word.ptWord.x + word.fWidth, |
26 word.ptWord.y + word.fDescent * 0.25f); | 23 word.ptWord.y + word.fDescent * 0.25f); |
27 } | 24 } |
28 | 25 |
29 CFX_FloatRect GetCrossoutRect(const CPVT_Word& word) { | 26 CFX_FloatRect GetCrossoutRect(const CPVT_Word& word) { |
30 return CFX_FloatRect(word.ptWord.x, | 27 return CFX_FloatRect(word.ptWord.x, |
31 word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f + | 28 word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f + |
32 word.fDescent * 0.25f, | 29 word.fDescent * 0.25f, |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 rcUnderline.left += ptOffset.x; | 639 rcUnderline.left += ptOffset.x; |
643 rcUnderline.right += ptOffset.x; | 640 rcUnderline.right += ptOffset.x; |
644 rcUnderline.top += ptOffset.y; | 641 rcUnderline.top += ptOffset.y; |
645 rcUnderline.bottom += ptOffset.y; | 642 rcUnderline.bottom += ptOffset.y; |
646 AddRectToPageObjects(pObjectHolder, color, rcUnderline); | 643 AddRectToPageObjects(pObjectHolder, color, rcUnderline); |
647 } | 644 } |
648 } | 645 } |
649 } | 646 } |
650 } | 647 } |
651 } | 648 } |
OLD | NEW |