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 #ifndef CORE_INCLUDE_FXCRT_FX_COORDINATES_H_ | 7 #ifndef CORE_INCLUDE_FXCRT_FX_COORDINATES_H_ |
8 #define CORE_INCLUDE_FXCRT_FX_COORDINATES_H_ | 8 #define CORE_INCLUDE_FXCRT_FX_COORDINATES_H_ |
9 | 9 |
10 #include "core/include/fxcrt/fx_basic.h" | 10 #include "core/include/fxcrt/fx_basic.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 int16_t top; | 136 int16_t top; |
137 int16_t right; | 137 int16_t right; |
138 int16_t bottom; | 138 int16_t bottom; |
139 }; | 139 }; |
140 | 140 |
141 struct FX_RECT { | 141 struct FX_RECT { |
142 FX_RECT() : left(0), top(0), right(0), bottom(0) {} | 142 FX_RECT() : left(0), top(0), right(0), bottom(0) {} |
143 | 143 |
144 FX_RECT(int l, int t, int r, int b) : left(l), top(t), right(r), bottom(b) {} | 144 FX_RECT(int l, int t, int r, int b) : left(l), top(t), right(r), bottom(b) {} |
145 | 145 |
146 explicit FX_RECT(const FX_SMALL_RECT& small) | 146 explicit FX_RECT(const FX_SMALL_RECT& other) |
147 : FX_RECT(small.left, small.top, small.right, small.bottom) {} | 147 : FX_RECT(other.left, other.top, other.right, other.bottom) {} |
148 | 148 |
149 int Width() const { return right - left; } | 149 int Width() const { return right - left; } |
150 int Height() const { return bottom - top; } | 150 int Height() const { return bottom - top; } |
151 bool IsEmpty() const { return right <= left || bottom <= top; } | 151 bool IsEmpty() const { return right <= left || bottom <= top; } |
152 | 152 |
153 void Normalize(); | 153 void Normalize(); |
154 | 154 |
155 void Intersect(const FX_RECT& src); | 155 void Intersect(const FX_RECT& src); |
156 void Intersect(int l, int t, int r, int b) { Intersect(FX_RECT(l, t, r, b)); } | 156 void Intersect(int l, int t, int r, int b) { Intersect(FX_RECT(l, t, r, b)); } |
157 | 157 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 public: | 661 public: |
662 FX_FLOAT a; | 662 FX_FLOAT a; |
663 FX_FLOAT b; | 663 FX_FLOAT b; |
664 FX_FLOAT c; | 664 FX_FLOAT c; |
665 FX_FLOAT d; | 665 FX_FLOAT d; |
666 FX_FLOAT e; | 666 FX_FLOAT e; |
667 FX_FLOAT f; | 667 FX_FLOAT f; |
668 }; | 668 }; |
669 | 669 |
670 #endif // CORE_INCLUDE_FXCRT_FX_COORDINATES_H_ | 670 #endif // CORE_INCLUDE_FXCRT_FX_COORDINATES_H_ |
OLD | NEW |