Android examples for Graphics:Rectangle
Calculates the y-coordinate of the top edge given the other sides of the rectangle and an aspect ratio.
//package com.java2s; public class Main { /**//w w w . j av a2s.c o m * Calculates the y-coordinate of the top edge given the other sides of the * rectangle and an aspect ratio. */ public static float calculateTop(float left, float right, float bottom, float targetAspectRatio) { final float width = right - left; final float top = bottom - (width / targetAspectRatio); return top; } }