range_f.cc 701 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2015 The Chromium 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. #include "ui/gfx/range/range_f.h"
  5. #include <stddef.h>
  6. #include <algorithm>
  7. #include <cmath>
  8. #include "base/format_macros.h"
  9. #include "base/strings/stringprintf.h"
  10. namespace gfx {
  11. RangeF RangeF::Intersect(const Range& range) const {
  12. RangeF range_f(range.start(), range.end());
  13. return Intersect(range_f);
  14. }
  15. std::string RangeF::ToString() const {
  16. return base::StringPrintf("{%f,%f}", start(), end());
  17. }
  18. std::ostream& operator<<(std::ostream& os, const RangeF& range) {
  19. return os << range.ToString();
  20. }
  21. } // namespace gfx