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