• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 PDFium Authors. All rights reserved.
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 #ifndef CORE_FPDFDOC_CPVT_FLOATRECT_H_
8 #define CORE_FPDFDOC_CPVT_FLOATRECT_H_
9 
10 #include "core/fxcrt/fx_coordinates.h"
11 
12 class CPVT_FloatRect final : public CFX_FloatRect {
13  public:
14   CPVT_FloatRect() = default;
15 
CPVT_FloatRect(float other_left,float other_top,float other_right,float other_bottom)16   CPVT_FloatRect(float other_left,
17                  float other_top,
18                  float other_right,
19                  float other_bottom)
20       : CFX_FloatRect(other_left, other_bottom, other_right, other_top) {}
21 
CPVT_FloatRect(const CFX_FloatRect & rect)22   explicit CPVT_FloatRect(const CFX_FloatRect& rect)
23       : CFX_FloatRect(rect.left, rect.bottom, rect.right, rect.top) {}
24 
Height()25   float Height() const {
26     if (top > bottom)
27       return top - bottom;
28     return bottom - top;
29   }
30 };
31 
32 #endif  // CORE_FPDFDOC_CPVT_FLOATRECT_H_
33