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 "xfa/fxgraphics/include/cfx_graphics.h" | 7 #include "xfa/fxgraphics/include/cfx_graphics.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 charPos[i].m_AdjustMatrix[2] = 0; | 1533 charPos[i].m_AdjustMatrix[2] = 0; |
1534 charPos[i].m_AdjustMatrix[3] = 1; | 1534 charPos[i].m_AdjustMatrix[3] = 1; |
1535 penX += (FX_FLOAT)(charPos[i].m_FontCharWidth) * m_info.fontSize / 1000 + | 1535 penX += (FX_FLOAT)(charPos[i].m_FontCharWidth) * m_info.fontSize / 1000 + |
1536 m_info.fontSpacing; | 1536 m_info.fontSpacing; |
1537 } | 1537 } |
1538 rect.width = (FX_FLOAT)penX - rect.left; | 1538 rect.width = (FX_FLOAT)penX - rect.left; |
1539 rect.height = rect.top + m_info.fontSize * m_info.fontHScale - rect.top; | 1539 rect.height = rect.top + m_info.fontSize * m_info.fontHScale - rect.top; |
1540 return FWL_Error::Succeeded; | 1540 return FWL_Error::Succeeded; |
1541 } | 1541 } |
1542 | 1542 |
| 1543 CFX_Graphics::TInfo::TInfo() |
| 1544 : isAntialiasing(TRUE), |
| 1545 strokeAlignment(FX_STROKEALIGNMENT_Center), |
| 1546 isActOnDash(FALSE), |
| 1547 strokeColor(nullptr), |
| 1548 fillColor(nullptr), |
| 1549 font(nullptr), |
| 1550 fontSize(40.0), |
| 1551 fontHScale(1.0), |
| 1552 fontSpacing(0.0) {} |
| 1553 |
1543 CFX_Graphics::TInfo::TInfo(const TInfo& info) | 1554 CFX_Graphics::TInfo::TInfo(const TInfo& info) |
1544 : graphState(info.graphState), | 1555 : graphState(info.graphState), |
1545 isAntialiasing(info.isAntialiasing), | 1556 isAntialiasing(info.isAntialiasing), |
1546 strokeAlignment(info.strokeAlignment), | 1557 strokeAlignment(info.strokeAlignment), |
1547 CTM(info.CTM), | 1558 CTM(info.CTM), |
1548 isActOnDash(info.isActOnDash), | 1559 isActOnDash(info.isActOnDash), |
1549 strokeColor(info.strokeColor), | 1560 strokeColor(info.strokeColor), |
1550 fillColor(info.fillColor), | 1561 fillColor(info.fillColor), |
1551 font(info.font), | 1562 font(info.font), |
1552 fontSize(info.fontSize), | 1563 fontSize(info.fontSize), |
1553 fontHScale(info.fontHScale), | 1564 fontHScale(info.fontHScale), |
1554 fontSpacing(info.fontSpacing) {} | 1565 fontSpacing(info.fontSpacing) {} |
1555 | 1566 |
1556 CFX_Graphics::TInfo& CFX_Graphics::TInfo::operator=(const TInfo& other) { | 1567 CFX_Graphics::TInfo& CFX_Graphics::TInfo::operator=(const TInfo& other) { |
1557 graphState.Copy(other.graphState); | 1568 graphState.Copy(other.graphState); |
1558 isAntialiasing = other.isAntialiasing; | 1569 isAntialiasing = other.isAntialiasing; |
1559 strokeAlignment = other.strokeAlignment; | 1570 strokeAlignment = other.strokeAlignment; |
1560 CTM = other.CTM; | 1571 CTM = other.CTM; |
1561 isActOnDash = other.isActOnDash; | 1572 isActOnDash = other.isActOnDash; |
1562 strokeColor = other.strokeColor; | 1573 strokeColor = other.strokeColor; |
1563 fillColor = other.fillColor; | 1574 fillColor = other.fillColor; |
1564 font = other.font; | 1575 font = other.font; |
1565 fontSize = other.fontSize; | 1576 fontSize = other.fontSize; |
1566 fontHScale = other.fontHScale; | 1577 fontHScale = other.fontHScale; |
1567 fontSpacing = other.fontSpacing; | 1578 fontSpacing = other.fontSpacing; |
1568 return *this; | 1579 return *this; |
1569 } | 1580 } |
OLD | NEW |