Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
text_glyph_pos.cpp
Go to the documentation of this file.
1
// Copyright 2019 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"core/fxge/text_glyph_pos.h"
8
9
#
include
"core/fxcrt/fx_safe_types.h"
10
#
include
"core/fxge/cfx_glyphbitmap.h"
11
12
TextGlyphPos
::
TextGlyphPos
() =
default
;
13
14
TextGlyphPos
::
TextGlyphPos
(
const
TextGlyphPos
&) =
default
;
15
16
TextGlyphPos
::~
TextGlyphPos
() =
default
;
17
18
std
::optional<
CFX_Point
>
TextGlyphPos
::
GetOrigin
(
19
const
CFX_Point
& offset)
const
{
20
FX_SAFE_INT32
left = m_Origin.x;
21
left += m_pGlyph->left();
22
left -= offset.x;
23
if
(!left.IsValid())
24
return
std
::nullopt;
25
26
FX_SAFE_INT32
top = m_Origin.y;
27
top -= m_pGlyph->top();
28
top -= offset.y;
29
if
(!top.IsValid())
30
return
std
::nullopt;
31
32
return
CFX_Point
(left.ValueOrDie(), top.ValueOrDie());
33
}
TextGlyphPos
Definition
text_glyph_pos.h:17
TextGlyphPos::~TextGlyphPos
~TextGlyphPos()
TextGlyphPos::TextGlyphPos
TextGlyphPos(const TextGlyphPos &)
TextGlyphPos::GetOrigin
std::optional< CFX_Point > GetOrigin(const CFX_Point &offset) const
Definition
text_glyph_pos.cpp:18
TextGlyphPos::TextGlyphPos
TextGlyphPos()
CFX_Point
CFX_PTemplate< int32_t > CFX_Point
Definition
fx_coordinates.h:50
FX_SAFE_INT32
pdfium::CheckedNumeric< int32_t > FX_SAFE_INT32
Definition
fx_safe_types.h:15
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxge
text_glyph_pos.cpp
Generated on
for Qt by
1.14.0