blob: e7da00ccf5e673e2001640f3a9db44101b1b28c4 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "cobalt/math/insets_base.h"
#include "cobalt/math/insets_f.h"
namespace cobalt {
namespace math {
// An integer version of Insets.
class Insets : public InsetsBase<Insets, int> {
Insets(int left, int top, int right, int bottom);
Insets Scale(float scale) const { return Scale(scale, scale); }
Insets Scale(float x_scale, float y_scale) const {
return Insets(static_cast<int>(left() * x_scale),
static_cast<int>(top() * y_scale),
static_cast<int>(right() * x_scale),
static_cast<int>(bottom() * y_scale));
operator InsetsF() const { return InsetsF(left(), top(), right(), bottom()); }
// Returns a string representation of the insets.
std::string ToString() const;
extern template class InsetsBase<Insets, int>;
} // namespace math
} // namespace cobalt