Scale AppPair background on hover.
Fix: 342133586 Test: manual. Flag: EXEMPT bugfix Change-Id: I2846b5543076688a90e8b9067f848c59e4081ea2
This commit is contained in:
@@ -380,6 +380,28 @@ public final class Utilities {
|
||||
outPivot.y = dst.top + dst.height() * pivotYPct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scales a {@code RectF} in place about a specified pivot point.
|
||||
*
|
||||
* <p>This method modifies the given {@code RectF} directly to scale it proportionally
|
||||
* by the given {@code scale}, while preserving its center at the specified
|
||||
* {@code (pivotX, pivotY)} coordinates.
|
||||
*
|
||||
* @param rectF the {@code RectF} to scale, modified directly.
|
||||
* @param pivotX the x-coordinate of the pivot point about which to scale.
|
||||
* @param pivotY the y-coordinate of the pivot point about which to scale.
|
||||
* @param scale the factor by which to scale the rectangle. Values less than 1 will
|
||||
* shrink the rectangle, while values greater than 1 will enlarge it.
|
||||
*/
|
||||
public static void scaleRectFAboutPivot(RectF rectF, float pivotX, float pivotY, float scale) {
|
||||
rectF.offset(-pivotX, -pivotY);
|
||||
rectF.left *= scale;
|
||||
rectF.top *= scale;
|
||||
rectF.right *= scale;
|
||||
rectF.bottom *= scale;
|
||||
rectF.offset(pivotX, pivotY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps t from one range to another range.
|
||||
* @param t The value to map.
|
||||
|
||||
Reference in New Issue
Block a user