зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1321412 - Add Min() and Max() functions to BaseSize. r=kats
MozReview-Commit-ID: 6GTzkpwwDNu --HG-- extra : rebase_source : 1d8e888649c10f8f044f475095cb592538992946
This commit is contained in:
Родитель
3a6277caff
Коммит
3fe1792b18
|
@ -6,6 +6,7 @@
|
|||
#ifndef MOZILLA_GFX_BASESIZE_H_
|
||||
#define MOZILLA_GFX_BASESIZE_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -92,6 +93,16 @@ struct BaseSize {
|
|||
Sub operator/(const Sub& aSize) const {
|
||||
return Sub(width / aSize.width, height / aSize.height);
|
||||
}
|
||||
|
||||
friend Sub Min(const Sub& aA, const Sub& aB) {
|
||||
return Sub(std::min(aA.width, aB.width),
|
||||
std::min(aA.height, aB.height));
|
||||
}
|
||||
|
||||
friend Sub Max(const Sub& aA, const Sub& aB) {
|
||||
return Sub(std::max(aA.width, aB.width),
|
||||
std::max(aA.height, aB.height));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace gfx
|
||||
|
|
Загрузка…
Ссылка в новой задаче