本文整理匯總了Java中android.graphics.RectF.union方法的典型用法代碼示例。如果您正苦於以下問題:Java RectF.union方法的具體用法?Java RectF.union怎麽用?Java RectF.union使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.graphics.RectF
的用法示例。
在下文中一共展示了RectF.union方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: invalidateAfterUpdate
import android.graphics.RectF; //導入方法依賴的package包/類
private void invalidateAfterUpdate() {
View view = mView.get();
if (view == null) {
return;
}
View parent = (View)view.getParent();
if (parent == null) {
return;
}
view.setAnimation(this);
final RectF after = mAfter;
computeRect(after, view);
after.union(mBefore);
parent.invalidate(
(int) Math.floor(after.left),
(int) Math.floor(after.top),
(int) Math.ceil(after.right),
(int) Math.ceil(after.bottom));
}
示例2: invalidateAfterUpdate
import android.graphics.RectF; //導入方法依賴的package包/類
private void invalidateAfterUpdate() {
View view = mView.get();
if (view == null || view.getParent() == null) {
return;
}
final RectF after = mAfter;
computeRect(after, view);
after.union(mBefore);
((View)view.getParent()).invalidate(
(int) Math.floor(after.left),
(int) Math.floor(after.top),
(int) Math.ceil(after.right),
(int) Math.ceil(after.bottom));
}
示例3: invalidateAfterUpdate
import android.graphics.RectF; //導入方法依賴的package包/類
private void invalidateAfterUpdate() {
View view = mView.get();
if (view == null || view.getParent() == null) {
return;
}
final RectF after = mAfter;
computeRect(after, view);
after.union(mBefore);
((View) view.getParent()).invalidate(
(int) Math.floor(after.left),
(int) Math.floor(after.top),
(int) Math.ceil(after.right),
(int) Math.ceil(after.bottom));
}
示例4: getYBoundsForHighlight
import android.graphics.RectF; //導入方法依賴的package包/類
public static RectF getYBoundsForHighlight(
Map<String, List<AyahBounds>> coordinateData, int sura, int ayah) {
final List<AyahBounds> ayahBounds = coordinateData.get(sura + ":" + ayah);
if (ayahBounds == null) {
return null;
}
RectF ayahBoundsRect = null;
for (AyahBounds bounds : ayahBounds) {
if (ayahBoundsRect == null) {
ayahBoundsRect = bounds.getBounds();
} else {
ayahBoundsRect.union(bounds.getBounds());
}
}
return ayahBoundsRect;
}
示例5: drawStrokePoint
import android.graphics.RectF; //導入方法依賴的package包/類
final void drawStrokePoint(CanvasLite c, float x, float y, float r, RectF dirty) {
switch (mShape) {
case SHAPE_SQUARE:
c.drawRect(x-r,y-r,x+r,y+r, mPaint);
break;
// case SHAPE_BITMAP_CIRCLE:
// tmpRF.set(x-r,y-r,x+r,y+r);
// if (mCircleBits == null || mCircleBitsFrame == null) {
// throw new RuntimeException("Slate.drawStrokePoint: no circle bitmap - frame=" + mCircleBitsFrame);
// }
// c.drawBitmap(mCircleBits, mCircleBitsFrame, tmpRF, mPaint);
// break;
case SHAPE_BITMAP_AIRBRUSH:
tmpRF.set(x-r,y-r,x+r,y+r);
if (mAirbrushBits == null || mAirbrushBitsFrame == null) {
throw new RuntimeException("Slate.drawStrokePoint: no airbrush bitmap - frame=" + mAirbrushBitsFrame);
}
c.drawBitmap(mAirbrushBits, mAirbrushBitsFrame, tmpRF, mPaint);
break;
case SHAPE_FOUNTAIN_PEN:
tmpRF.set(x-r,y-r,x+r,y+r);
if (mFountainPenBits == null || mFountainPenBitsFrame == null) {
throw new RuntimeException("Slate.drawStrokePoint: no fountainpen bitmap - frame=" + mFountainPenBitsFrame);
}
c.drawBitmap(mFountainPenBits, mFountainPenBitsFrame, tmpRF, mPaint);
break;
case SHAPE_CIRCLE:
default:
c.drawCircle(x, y, r, mPaint);
break;
}
dirty.union(x-r, y-r, x+r, y+r);
}
示例6: invalidateAfterUpdate
import android.graphics.RectF; //導入方法依賴的package包/類
private void invalidateAfterUpdate() {
View view = (View) this.mView.get();
if (view != null && view.getParent() != null) {
RectF after = this.mAfter;
computeRect(after, view);
after.union(this.mBefore);
((View) view.getParent()).invalidate((int) Math.floor((double) after.left), (int)
Math.floor((double) after.top), (int) Math.ceil((double) after.right), (int)
Math.ceil((double) after.bottom));
}
}