Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: ppapi/cpp/rect.cc

Issue 13220002: [PPAPI] Fix a bunch of spelling mistakes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/cpp/rect.h ('k') | ppapi/cpp/url_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/cpp/rect.h" 5 #include "ppapi/cpp/rect.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 namespace { 9 namespace {
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return *this; 82 return *this;
83 if (rect.Contains(*this)) 83 if (rect.Contains(*this))
84 return Rect(); 84 return Rect();
85 85
86 int32_t rx = x(); 86 int32_t rx = x();
87 int32_t ry = y(); 87 int32_t ry = y();
88 int32_t rr = right(); 88 int32_t rr = right();
89 int32_t rb = bottom(); 89 int32_t rb = bottom();
90 90
91 if (rect.y() <= y() && rect.bottom() >= bottom()) { 91 if (rect.y() <= y() && rect.bottom() >= bottom()) {
92 // complete int32_tersection in the y-direction 92 // complete intersection in the y-direction
93 if (rect.x() <= x()) { 93 if (rect.x() <= x()) {
94 rx = rect.right(); 94 rx = rect.right();
95 } else { 95 } else {
96 rr = rect.x(); 96 rr = rect.x();
97 } 97 }
98 } else if (rect.x() <= x() && rect.right() >= right()) { 98 } else if (rect.x() <= x() && rect.right() >= right()) {
99 // complete int32_tersection in the x-direction 99 // complete intersection in the x-direction
100 if (rect.y() <= y()) { 100 if (rect.y() <= y()) {
101 ry = rect.bottom(); 101 ry = rect.bottom();
102 } else { 102 } else {
103 rb = rect.y(); 103 rb = rect.y();
104 } 104 }
105 } 105 }
106 return Rect(rx, ry, rr - rx, rb - ry); 106 return Rect(rx, ry, rr - rx, rb - ry);
107 } 107 }
108 108
109 Rect Rect::AdjustToFit(const Rect& rect) const { 109 Rect Rect::AdjustToFit(const Rect& rect) const {
(...skipping 11 matching lines...) Expand all
121 } 121 }
122 122
123 bool Rect::SharesEdgeWith(const Rect& rect) const { 123 bool Rect::SharesEdgeWith(const Rect& rect) const {
124 return (y() == rect.y() && height() == rect.height() && 124 return (y() == rect.y() && height() == rect.height() &&
125 (x() == rect.right() || right() == rect.x())) || 125 (x() == rect.right() || right() == rect.x())) ||
126 (x() == rect.x() && width() == rect.width() && 126 (x() == rect.x() && width() == rect.width() &&
127 (y() == rect.bottom() || bottom() == rect.y())); 127 (y() == rect.bottom() || bottom() == rect.y()));
128 } 128 }
129 129
130 } // namespace pp 130 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/rect.h ('k') | ppapi/cpp/url_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698