Tracker: Replace max_c() with std::max()

This commit is contained in:
John Scipione
2014-06-10 00:36:11 -04:00
parent 9437e677ba
commit 157e4b428a
+9 -7
View File
@@ -62,6 +62,7 @@ All rights reserved.
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <algorithm>
#include <memory> #include <memory>
#include "Attributes.h" #include "Attributes.h"
@@ -1142,15 +1143,16 @@ BContainerWindow::FrameResized(float, float)
// and we have resized over the bottom right corner of the extent // and we have resized over the bottom right corner of the extent
BPoint scroll(B_ORIGIN); BPoint scroll(B_ORIGIN);
if (offsetX < 0 && PoseView()->Bounds().right > extent.right if (offsetX < 0 && PoseView()->Bounds().right > extent.right
&& Bounds().Width() > fPreviousBounds.Width()) && Bounds().Width() > fPreviousBounds.Width()) {
scroll.x scroll.x = std::max(fPreviousBounds.Width() - Bounds().Width(),
= max_c(fPreviousBounds.Width() - Bounds().Width(), offsetX); offsetX);
}
if (offsetY < 0 && PoseView()->Bounds().bottom > extent.bottom if (offsetY < 0 && PoseView()->Bounds().bottom > extent.bottom
&& Bounds().Height() > fPreviousBounds.Height()) && Bounds().Height() > fPreviousBounds.Height()) {
scroll.y scroll.y = std::max(fPreviousBounds.Height() - Bounds().Height(),
= max_c(fPreviousBounds.Height() - Bounds().Height(), offsetY);
offsetY); }
if (scroll != B_ORIGIN) if (scroll != B_ORIGIN)
PoseView()->ScrollBy(scroll.x, scroll.y); PoseView()->ScrollBy(scroll.x, scroll.y);