summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Wnd.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2017-02-14 14:58:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-02-14 14:59:09 +0000
commit92a32db931c1303388158f8a9e045e922d0b8dfa (patch)
tree5c6c05ffb40c1bb2653b415842537f7043bd6407 /fpdfsdk/pdfwindow/PWL_Wnd.cpp
parent4797c4240cb9e2d8cd36c583d46cd52ff94af95d (diff)
downloadpdfium-92a32db931c1303388158f8a9e045e922d0b8dfa.tar.xz
Revert "Convert CFX_FloatPoint to CFX_PointF"
This reverts commit 4797c4240cb9e2d8cd36c583d46cd52ff94af95d. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert CFX_FloatPoint to CFX_PointF > > The two classes store the same information, remove the CFX_FloatPoint variant. > > Change-Id: Ie598c2ba5af04fb2bb3347dd48c30fd5e4845e62 > Reviewed-on: https://pdfium-review.googlesource.com/2612 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Tom Sepez <tsepez@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia42074e706983c62d2e57497c3079b3c338343a3 Reviewed-on: https://pdfium-review.googlesource.com/2694 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Wnd.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index cf573220b7..1170660f1c 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -426,7 +426,8 @@ PWL_IMPLEMENT_KEY_METHOD(OnChar)
#undef PWL_IMPLEMENT_KEY_METHOD
#define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name) \
- bool CPWL_Wnd::mouse_method_name(const CFX_PointF& point, uint32_t nFlag) { \
+ bool CPWL_Wnd::mouse_method_name(const CFX_FloatPoint& point, \
+ uint32_t nFlag) { \
if (!IsValid() || !IsVisible() || !IsEnabled()) \
return false; \
if (IsWndCaptureMouse(this)) { \
@@ -461,7 +462,7 @@ PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
#undef PWL_IMPLEMENT_MOUSE_METHOD
bool CPWL_Wnd::OnMouseWheel(short zDelta,
- const CFX_PointF& point,
+ const CFX_FloatPoint& point,
uint32_t nFlag) {
if (!IsValid() || !IsVisible() || !IsEnabled())
return false;
@@ -533,10 +534,10 @@ CFX_FloatRect CPWL_Wnd::GetClientRect() const {
return rcWindow.Contains(rcClient) ? rcClient : CFX_FloatRect();
}
-CFX_PointF CPWL_Wnd::GetCenterPoint() const {
+CFX_FloatPoint CPWL_Wnd::GetCenterPoint() const {
CFX_FloatRect rcClient = GetClientRect();
- return CFX_PointF((rcClient.left + rcClient.right) * 0.5f,
- (rcClient.top + rcClient.bottom) * 0.5f);
+ return CFX_FloatPoint((rcClient.left + rcClient.right) * 0.5f,
+ (rcClient.top + rcClient.bottom) * 0.5f);
}
bool CPWL_Wnd::HasFlag(uint32_t dwFlags) const {
@@ -672,11 +673,11 @@ void CPWL_Wnd::OnSetFocus() {}
void CPWL_Wnd::OnKillFocus() {}
-bool CPWL_Wnd::WndHitTest(const CFX_PointF& point) const {
+bool CPWL_Wnd::WndHitTest(const CFX_FloatPoint& point) const {
return IsValid() && IsVisible() && GetWindowRect().Contains(point.x, point.y);
}
-bool CPWL_Wnd::ClientHitTest(const CFX_PointF& point) const {
+bool CPWL_Wnd::ClientHitTest(const CFX_FloatPoint& point) const {
return IsValid() && IsVisible() && GetClientRect().Contains(point.x, point.y);
}
@@ -849,9 +850,11 @@ CFX_Matrix CPWL_Wnd::GetWindowMatrix() const {
return mt;
}
-void CPWL_Wnd::PWLtoWnd(const CFX_PointF& point, int32_t& x, int32_t& y) const {
+void CPWL_Wnd::PWLtoWnd(const CFX_FloatPoint& point,
+ int32_t& x,
+ int32_t& y) const {
CFX_Matrix mt = GetWindowMatrix();
- CFX_PointF pt = point;
+ CFX_FloatPoint pt = point;
mt.TransformPoint(pt.x, pt.y);
x = (int32_t)(pt.x + 0.5);
y = (int32_t)(pt.y + 0.5);
@@ -865,12 +868,12 @@ FX_RECT CPWL_Wnd::PWLtoWnd(const CFX_FloatRect& rect) const {
(int32_t)(rcTemp.right + 0.5), (int32_t)(rcTemp.top + 0.5));
}
-CFX_PointF CPWL_Wnd::ChildToParent(const CFX_PointF& point) const {
+CFX_FloatPoint CPWL_Wnd::ChildToParent(const CFX_FloatPoint& point) const {
CFX_Matrix mt = GetChildMatrix();
if (mt.IsIdentity())
return point;
- CFX_PointF pt = point;
+ CFX_FloatPoint pt = point;
mt.TransformPoint(pt.x, pt.y);
return pt;
}
@@ -885,13 +888,13 @@ CFX_FloatRect CPWL_Wnd::ChildToParent(const CFX_FloatRect& rect) const {
return rc;
}
-CFX_PointF CPWL_Wnd::ParentToChild(const CFX_PointF& point) const {
+CFX_FloatPoint CPWL_Wnd::ParentToChild(const CFX_FloatPoint& point) const {
CFX_Matrix mt = GetChildMatrix();
if (mt.IsIdentity())
return point;
mt.SetReverse(mt);
- CFX_PointF pt = point;
+ CFX_FloatPoint pt = point;
mt.TransformPoint(pt.x, pt.y);
return pt;
}