Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / gfx / geometry / size_f.cc
index 10c1445..6d08e18 100644 (file)
@@ -8,7 +8,23 @@
 
 namespace gfx {
 
-template class SizeBase<SizeF, float>;
+float SizeF::GetArea() const {
+  return width() * height();
+}
+
+void SizeF::Enlarge(float grow_width, float grow_height) {
+  SetSize(width() + grow_width, height() + grow_height);
+}
+
+void SizeF::SetToMin(const SizeF& other) {
+  width_ = width() <= other.width() ? width() : other.width();
+  height_ = height() <= other.height() ? height() : other.height();
+}
+
+void SizeF::SetToMax(const SizeF& other) {
+  width_ = width() >= other.width() ? width() : other.width();
+  height_ = height() >= other.height() ? height() : other.height();
+}
 
 std::string SizeF::ToString() const {
   return base::StringPrintf("%fx%f", width(), height());