本文整理汇总了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));
}
}