Lines Matching refs:top

27  * represented by the coordinates of its 4 edges (left, top, right bottom).
30 * the coordinates are sorted correctly (i.e. left <= right and top <= bottom).
34 public float top;
46 * top <= bottom.
49 * @param top The Y coordinate of the top of the rectangle
53 public RectF(float left, float top, float right, float bottom) {
55 this.top = top;
69 left = top = right = bottom = 0.0f;
72 top = r.top;
80 left = top = right = bottom = 0.0f;
83 top = r.top;
95 return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
101 result = 31 * result + (top != +0.0f ? Float.floatToIntBits(top) : 0);
108 return "RectF(" + left + ", " + top + ", "
126 sb.append(top); sb.append("]["); sb.append(right);
137 pw.print(top); pw.print("]["); pw.print(right);
142 * Returns true if the rectangle is empty (left >= right or top >= bottom)
145 return left >= right || top >= bottom;
158 * (i.e. top <= bottom) so the result may be negative.
161 return bottom - top;
174 * a valid rectangle (i.e. top <= bottom)
177 return (top + bottom) * 0.5f;
184 left = right = top = bottom = 0;
190 * left <= right and top <= bottom.
193 * @param top The Y coordinate of the top of the rectangle
197 public void set(float left, float top, float right, float bottom) {
199 this.top = top;
212 this.top = src.top;
225 this.top = src.top;
232 * adding dy to its top and bottom coordinates.
235 * @param dy The amount to add to the rectangle's top and bottom coordinates
239 top += dy;
245 * Offset the rectangle to a specific (left, top) position,
249 * @param newTop The new "top" coordinate for the rectangle
253 bottom += newTop - top;
255 top = newTop;
262 * for dy and the top and bottom.
265 * @param dy The amount to add(subtract) from the rectangle's top(bottom)
269 top += dy;
275 * Returns true if (x,y) is inside the rectangle. The left and top are
277 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
283 * means left <= x < right and top <= y < bottom
286 return left < right && top < bottom // check for empty first
287 && x >= left && x < right && y >= top && y < bottom;
296 * @param top The top of the rectangle being tested for containment
302 public boolean contains(float left, float top, float right, float bottom) {
304 return this.left < this.right && this.top < this.bottom
306 && this.left <= left && this.top <= top
320 return this.left < this.right && this.top < this.bottom
322 && left <= r.left && top <= r.top
327 * If the rectangle specified by left,top,right,bottom intersects this
335 * @param top The top of the rectangle being intersected with this rectangle
344 public boolean intersect(float left, float top, float right, float bottom) {
346 && this.top < bottom && top < this.bottom) {
350 if (this.top < top) {
351 this.top = top;
376 return intersect(r.left, r.top, r.right, r.bottom);
393 && a.top < b.bottom && b.top < a.bottom) {
395 top = Math.max(a.top, b.top);
410 * @param top The top of the rectangle being tested for intersection
417 public boolean intersects(float left, float top, float right,
420 && this.top < bottom && top < this.bottom;
435 && a.top < b.bottom && b.top < a.bottom;
443 dst.set(FastMath.round(left), FastMath.round(top),
449 * floor of top and left, and the ceiling of right and bottom.
452 dst.set((int) Math.floor(left), (int) Math.floor(top),
462 * @param top The top edge being unioned with this rectangle
466 public void union(float left, float top, float right, float bottom) {
467 if ((left < right) && (top < bottom)) {
468 if ((this.left < this.right) && (this.top < this.bottom)) {
471 if (this.top > top)
472 this.top = top;
479 this.top = top;
494 union(r.left, r.top, r.right, r.bottom);
510 if (y < top) {
511 top = y;
518 * Swap top/bottom or left/right if there are flipped (i.e. left > right
519 * and/or top > bottom). This can be called if
521 * If the edges are already correct (i.e. left <= right and top <= bottom)
530 if (top > bottom) {
531 float temp = top;
532 top = bottom;
551 out.writeFloat(top);
582 top = in.readFloat();