final int width = getLocalComponentWidth();
return getRelativeComponentBounds(rVal, width, height);
}
private Rectangle2 getRelativeComponentBounds(final Rectangle2 store, final int width, final int height) {
final ReadOnlyTransform local = getTransform();
if (local.isIdentity() || local.getMatrix().isIdentity()) {
store.set(0, 0, width, height);
} else {
float minX, maxX, minY, maxY;
final Vector3 t = Vector3.fetchTempInstance();
t.set(width, height, 0);
local.applyForwardVector(t);
minX = Math.min(t.getXf(), 0);
maxX = Math.max(t.getXf(), 0);
minY = Math.min(t.getYf(), 0);
maxY = Math.max(t.getYf(), 0);
t.set(0, height, 0);
local.applyForwardVector(t);
minX = Math.min(t.getXf(), minX);
maxX = Math.max(t.getXf(), maxX);
minY = Math.min(t.getYf(), minY);
maxY = Math.max(t.getYf(), maxY);
t.set(width, 0, 0);
local.applyForwardVector(t);
minX = Math.min(t.getXf(), minX);
maxX = Math.max(t.getXf(), maxX);
minY = Math.min(t.getYf(), minY);
maxY = Math.max(t.getYf(), maxY);