| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #include <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "ui/gfx/rect_base.h" | |
| 8 | |
| 9 #include "base/logging.h" | 7 #include "base/logging.h" |
| 10 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "ui/gfx/geometry/rect_base.h" |
| 11 | 10 |
| 12 // This file provides the implementation for RectBaese template and | 11 // This file provides the implementation for RectBaese template and |
| 13 // used to instantiate the base class for Rect and RectF classes. | 12 // used to instantiate the base class for Rect and RectF classes. |
| 14 #if !defined(GFX_IMPLEMENTATION) | 13 #if !defined(GFX_IMPLEMENTATION) |
| 15 #error "This file is intended for UI implementation only" | 14 #error "This file is intended for UI implementation only" |
| 16 #endif | 15 #endif |
| 17 | 16 |
| 18 namespace { | 17 namespace { |
| 19 | 18 |
| 20 template<typename Type> | 19 template<typename Type> |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 static const Type kEpsilon = std::numeric_limits<Type>::is_integer | 345 static const Type kEpsilon = std::numeric_limits<Type>::is_integer |
| 347 ? 1 | 346 ? 1 |
| 348 : std::numeric_limits<Type>::epsilon(); | 347 : std::numeric_limits<Type>::epsilon(); |
| 349 | 348 |
| 350 Type x = std::max<Type>(0, c.width() - width() - rect.width() + kEpsilon); | 349 Type x = std::max<Type>(0, c.width() - width() - rect.width() + kEpsilon); |
| 351 Type y = std::max<Type>(0, c.height() - height() - rect.height() + kEpsilon); | 350 Type y = std::max<Type>(0, c.height() - height() - rect.height() + kEpsilon); |
| 352 return x + y; | 351 return x + y; |
| 353 } | 352 } |
| 354 | 353 |
| 355 } // namespace gfx | 354 } // namespace gfx |
| OLD | NEW |