Lines Matching refs:right

29  * represented by the coordinates of its 4 edges (left, top, right bottom).
32 * the coordinates are sorted correctly (i.e. left <= right and top <= bottom).
37 public int right;
62 * checking is performed, so the caller must ensure that left <= right and
67 * @param right The X coordinate of the right side of the rectangle
70 public Rect(int left, int top, int right, int bottom) {
73 this.right = right;
86 left = top = right = bottom = 0;
90 right = r.right;
101 return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
108 result = 31 * result + right;
117 sb.append(top); sb.append(" - "); sb.append(right);
136 sb.append(top); sb.append("]["); sb.append(right);
147 * @return Returns a new String of the form "left top right bottom"
157 sb.append(right);
184 pw.print(top); pw.print("]["); pw.print(right);
189 * Returns true if the rectangle is empty (left >= right or top >= bottom)
192 return left >= right || top >= bottom;
197 * (i.e. left <= right) so the result may be negative.
200 return right - left;
217 return (left + right) >> 1;
233 return (left + right) * 0.5f;
247 left = right = top = bottom = 0;
253 * left <= right and top <= bottom.
257 * @param right The X coordinate of the right side of the rectangle
260 public void set(int left, int top, int right, int bottom) {
263 this.right = right;
276 this.right = src.right;
281 * Offset the rectangle by adding dx to its left and right coordinates, and
284 * @param dx The amount to add to the rectangle's left and right coordinates
290 right += dx;
302 right += newLeft - left;
314 * @param dx The amount to add(subtract) from the rectangle's left(right)
320 right -= dx;
326 * considered to be inside, while the right and bottom are not. This means
327 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
333 * means left <= x < right and top <= y < bottom
336 return left < right && top < bottom // check for empty first
337 && x >= left && x < right && y >= top && y < bottom;
347 * @param right The right side of the rectangle being tested for containment
352 public boolean contains(int left, int top, int right, int bottom) {
354 return this.left < this.right && this.top < this.bottom
357 && this.right >= right && this.bottom >= bottom;
370 return this.left < this.right && this.top < this.bottom
372 && left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
376 * If the rectangle specified by left,top,right,bottom intersects this
385 * @param right The right side of the rectangle being intersected with this
394 public boolean intersect(int left, int top, int right, int bottom) {
395 if (this.left < right && left < this.right && this.top < bottom && top < this.bottom) {
398 if (this.right > right) this.right = right;
418 return intersect(r.left, r.top, r.right, r.bottom);
435 if (a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom) {
438 right = Math.min(a.right, b.right);
453 * @param right The right side of the rectangle being tested for
459 public boolean intersects(int left, int top, int right, int bottom) {
460 return this.left < right && left < this.right && this.top < bottom && top < this.bottom;
474 return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
484 * @param right The right edge being unioned with this rectangle
487 public void union(int left, int top, int right, int bottom) {
488 if ((left < right) && (top < bottom)) {
489 if ((this.left < this.right) && (this.top < this.bottom)) {
492 if (this.right < right) this.right = right;
497 this.right = right;
511 union(r.left, r.top, r.right, r.bottom);
524 } else if (x > right) {
525 right = x;
535 * Swap top/bottom or left/right if there are flipped (i.e. left > right
538 * If the edges are already correct (i.e. left <= right and top <= bottom)
542 if (left > right) {
544 left = right;
545 right = temp;
569 out.writeInt(right);
600 right = in.readInt();
612 right = (int) (right * scale + 0.5f);
625 right = (int) Math.floor(right * scale);