Lines Matching refs:right

28  * represented by the coordinates of its 4 edges (left, top, right bottom).
31 * the coordinates are sorted correctly (i.e. left <= right and top <= bottom).
36 public int right;
49 * checking is performed, so the caller must ensure that left <= right and
54 * @param right The X coordinate of the right side of the rectangle
57 public Rect(int left, int top, int right, int bottom) {
60 this.right = right;
73 left = top = right = bottom = 0;
77 right = r.right;
88 return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
95 result = 31 * result + right;
104 sb.append(top); sb.append(" - "); sb.append(right);
123 sb.append(top); sb.append("]["); sb.append(right);
134 * @return Returns a new String of the form "left top right bottom"
144 sb.append(right);
171 pw.print(top); pw.print("]["); pw.print(right);
176 * Returns true if the rectangle is empty (left >= right or top >= bottom)
179 return left >= right || top >= bottom;
184 * (i.e. left <= right) so the result may be negative.
187 return right - left;
204 return (left + right) >> 1;
220 return (left + right) * 0.5f;
234 left = right = top = bottom = 0;
240 * left <= right and top <= bottom.
244 * @param right The X coordinate of the right side of the rectangle
247 public void set(int left, int top, int right, int bottom) {
250 this.right = right;
263 this.right = src.right;
268 * Offset the rectangle by adding dx to its left and right coordinates, and
271 * @param dx The amount to add to the rectangle's left and right coordinates
277 right += dx;
289 right += newLeft - left;
301 * @param dx The amount to add(subtract) from the rectangle's left(right)
307 right -= dx;
313 * considered to be inside, while the right and bottom are not. This means
314 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
320 * means left <= x < right and top <= y < bottom
323 return left < right && top < bottom // check for empty first
324 && x >= left && x < right && y >= top && y < bottom;
334 * @param right The right side of the rectangle being tested for containment
339 public boolean contains(int left, int top, int right, int bottom) {
341 return this.left < this.right && this.top < this.bottom
344 && this.right >= right && this.bottom >= bottom;
357 return this.left < this.right && this.top < this.bottom
359 && left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
363 * If the rectangle specified by left,top,right,bottom intersects this
372 * @param right The right side of the rectangle being intersected with this
380 public boolean intersect(int left, int top, int right, int bottom) {
381 if (this.left < right && left < this.right && this.top < bottom && top < this.bottom) {
384 if (this.right > right) this.right = right;
403 return intersect(r.left, r.top, r.right, r.bottom);
419 if (a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom) {
422 right = Math.min(a.right, b.right);
437 * @param right The right side of the rectangle being tested for
443 public boolean intersects(int left, int top, int right, int bottom) {
444 return this.left < right && left < this.right && this.top < bottom && top < this.bottom;
458 return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
468 * @param right The right edge being unioned with this rectangle
471 public void union(int left, int top, int right, int bottom) {
472 if ((left < right) && (top < bottom)) {
473 if ((this.left < this.right) && (this.top < this.bottom)) {
476 if (this.right < right) this.right = right;
481 this.right = right;
495 union(r.left, r.top, r.right, r.bottom);
508 } else if (x > right) {
509 right = x;
519 * Swap top/bottom or left/right if there are flipped (i.e. left > right
522 * If the edges are already correct (i.e. left <= right and top <= bottom)
526 if (left > right) {
528 left = right;
529 right = temp;
553 out.writeInt(right);
584 right = in.readInt();
596 right = (int) (right * scale + 0.5f);