Android examples for Graphics:Rectangle
Calculates the x-coordinate of the right edge given the other sides of the rectangle and an aspect ratio.
//package com.java2s; public class Main { /**/*from w w w .ja v a 2 s .c o m*/ * Calculates the x-coordinate of the right edge given the other sides of * the rectangle and an aspect ratio. */ public static float calculateRight(float left, float top, float bottom, float targetAspectRatio) { final float height = bottom - top; final float right = (targetAspectRatio * height) + left; return right; } }