Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: fpdfsdk/src/fxedit/fxet_pageobjs.cpp

Issue 1752543002: Add CFX_FloatRect::ToFxRect(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxcrt/fx_basic_coords.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Utils.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/include/fpdfapi/fpdf_pageobj.h" 7 #include "core/include/fpdfapi/fpdf_pageobj.h"
8 #include "core/include/fpdfapi/fpdf_render.h" 8 #include "core/include/fpdfapi/fpdf_render.h"
9 #include "fpdfsdk/include/fx_systemhandler.h" 9 #include "fpdfsdk/include/fx_systemhandler.h"
10 #include "fpdfsdk/include/fxedit/fx_edit.h" 10 #include "fpdfsdk/include/fxedit/fx_edit.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 IFX_Edit* pEdit, 93 IFX_Edit* pEdit,
94 FX_COLORREF color, 94 FX_COLORREF color,
95 const CFX_FloatRect& rcClip, 95 const CFX_FloatRect& rcClip,
96 const CFX_FloatPoint& ptOffset, 96 const CFX_FloatPoint& ptOffset,
97 const CPVT_WordRange* pRange) { 97 const CPVT_WordRange* pRange) {
98 pDevice->SaveState(); 98 pDevice->SaveState();
99 99
100 if (!rcClip.IsEmpty()) { 100 if (!rcClip.IsEmpty()) {
101 CFX_FloatRect rcTemp = rcClip; 101 CFX_FloatRect rcTemp = rcClip;
102 pUser2Device->TransformRect(rcTemp); 102 pUser2Device->TransformRect(rcTemp);
103 pDevice->SetClip_Rect(FX_RECT((int32_t)rcTemp.left, (int32_t)rcTemp.top, 103 pDevice->SetClip_Rect(rcTemp.ToFxRect());
104 (int32_t)rcTemp.right,
105 (int32_t)rcTemp.bottom));
106 } 104 }
107 105
108 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { 106 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) {
109 if (pEdit->GetFontMap()) { 107 if (pEdit->GetFontMap()) {
110 if (pRange) 108 if (pRange)
111 pIterator->SetAt(pRange->BeginPos); 109 pIterator->SetAt(pRange->BeginPos);
112 else 110 else
113 pIterator->SetAt(0); 111 pIterator->SetAt(0);
114 112
115 while (pIterator->NextWord()) { 113 while (pIterator->NextWord()) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 162
165 CFX_ByteTextBuf sTextBuf; 163 CFX_ByteTextBuf sTextBuf;
166 int32_t nFontIndex = -1; 164 int32_t nFontIndex = -1;
167 CFX_FloatPoint ptBT(0.0f, 0.0f); 165 CFX_FloatPoint ptBT(0.0f, 0.0f);
168 166
169 pDevice->SaveState(); 167 pDevice->SaveState();
170 168
171 if (!rcClip.IsEmpty()) { 169 if (!rcClip.IsEmpty()) {
172 CFX_FloatRect rcTemp = rcClip; 170 CFX_FloatRect rcTemp = rcClip;
173 pUser2Device->TransformRect(rcTemp); 171 pUser2Device->TransformRect(rcTemp);
174 pDevice->SetClip_Rect(FX_RECT((int32_t)rcTemp.left, (int32_t)rcTemp.top, 172 pDevice->SetClip_Rect(rcTemp.ToFxRect());
175 (int32_t)rcTemp.right,
176 (int32_t)rcTemp.bottom));
177 } 173 }
178 174
179 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { 175 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) {
180 if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap()) { 176 if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap()) {
181 if (pRange) 177 if (pRange)
182 pIterator->SetAt(pRange->BeginPos); 178 pIterator->SetAt(pRange->BeginPos);
183 else 179 else
184 pIterator->SetAt(0); 180 pIterator->SetAt(0);
185 181
186 CPVT_WordPlace oldplace; 182 CPVT_WordPlace oldplace;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 282
287 CFX_ByteTextBuf sTextBuf; 283 CFX_ByteTextBuf sTextBuf;
288 CPVT_WordProps wp; 284 CPVT_WordProps wp;
289 CFX_FloatPoint ptBT(0.0f, 0.0f); 285 CFX_FloatPoint ptBT(0.0f, 0.0f);
290 286
291 pDevice->SaveState(); 287 pDevice->SaveState();
292 288
293 if (!rcClip.IsEmpty()) { 289 if (!rcClip.IsEmpty()) {
294 CFX_FloatRect rcTemp = rcClip; 290 CFX_FloatRect rcTemp = rcClip;
295 pUser2Device->TransformRect(rcTemp); 291 pUser2Device->TransformRect(rcTemp);
296 pDevice->SetClip_Rect(FX_RECT((int32_t)rcTemp.left, (int32_t)rcTemp.top, 292 pDevice->SetClip_Rect(rcTemp.ToFxRect());
297 (int32_t)rcTemp.right,
298 (int32_t)rcTemp.bottom));
299 } 293 }
300 294
301 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { 295 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) {
302 if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap()) { 296 if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap()) {
303 if (pRange) 297 if (pRange)
304 pIterator->SetAt(pRange->BeginPos); 298 pIterator->SetAt(pRange->BeginPos);
305 else 299 else
306 pIterator->SetAt(0); 300 pIterator->SetAt(0);
307 301
308 CPVT_WordPlace oldplace; 302 CPVT_WordPlace oldplace;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 rcUnderline.left += ptOffset.x; 631 rcUnderline.left += ptOffset.x;
638 rcUnderline.right += ptOffset.x; 632 rcUnderline.right += ptOffset.x;
639 rcUnderline.top += ptOffset.y; 633 rcUnderline.top += ptOffset.y;
640 rcUnderline.bottom += ptOffset.y; 634 rcUnderline.bottom += ptOffset.y;
641 AddRectToPageObjects(pObjectHolder, color, rcUnderline); 635 AddRectToPageObjects(pObjectHolder, color, rcUnderline);
642 } 636 }
643 } 637 }
644 } 638 }
645 } 639 }
646 } 640 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_coords.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698