微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.graphics.Region.Op的实例源码

项目:xwallet    文件CircleLayout.java   
private void drawChild(Canvas canvas,View child,LayoutParams lp) {
    mSrcCanvas.drawColor(Color.TRANSPARENT,PorterDuff.Mode.CLEAR);
    mdstCanvas.drawColor(Color.TRANSPARENT,PorterDuff.Mode.CLEAR);

    mSrcCanvas.save();

    int childLeft = child.getLeft();
    int childTop = child.getTop();
    int childRight = child.getRight();
    int childBottom = child.getBottom();

    mSrcCanvas.clipRect(childLeft,childTop,childRight,childBottom,Op.REPLACE);
    mSrcCanvas.translate(childLeft,childTop);

    child.draw(mSrcCanvas);

    mSrcCanvas.restore();

    mXferPaint.setXfermode(null);
    mXferPaint.setColor(Color.BLACK);

    float sweepAngle = (lp.endAngle - lp.startAngle) % 361;

    mdstCanvas.drawArc(mBounds,lp.startAngle,sweepAngle,true,mXferPaint);
    mXferPaint.setXfermode(mXfer);
    mdstCanvas.drawBitmap(mSrc,0f,mXferPaint);

    canvas.drawBitmap(mdst,null);
}
项目:PaintPlusPlus    文件Selection.java   
void commitSelectionoval(Rect rect,Op op)
{
    ActionSelectionChange action = new ActionSelectionChange(image);
    action.s@R_404_6440@ldRegion();

    RectF rectF = new RectF(rect);
    Path ovalPath = new Path();
    ovalPath.addoval(rectF,CW);

    Region ovalRegion = new Region();
    ovalRegion.setPath(ovalPath,new Region(0,imageRect.right,imageRect.bottom));

    region.op(ovalRegion,op);
    updatePath();

    action.applyAction();
}
项目:FMTech    文件TouchVisualizationView.java   
private final boolean a(ghu paramghu,boolean paramBoolean,Canvas paramCanvas)
{
  int j = 255;
  if (getDrawingTime() >= paramghu.e + this.g) {
    return false;
  }
  if (paramBoolean)
  {
    float f1 = 1.0F - (float)(getDrawingTime() - paramghu.e) / this.g;
    j = efj.a(Math.round(255.0F * (f1 * f1)),j);
  }
  this.d.setAlpha(j);
  if (this.h != null)
  {
    this.h.setBounds(paramghu.a(0,0));
    this.h.draw(paramCanvas);
  }
  for (;;)
  {
    return true;
    paramCanvas.clipRect(paramghu.a(0,0),Region.Op.UNION);
    paramCanvas.drawCircle(paramghu.a,paramghu.b,paramghu.c,this.d);
  }
}
项目:TurboLauncher    文件BubbleTextView.java   
/**
 * Draw this BubbleTextView into the given Canvas.
 *
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private void drawWithPadding(Canvas destCanvas,int padding) {
    final Rect clipRect = mTempRect;
    getDrawingRect(clipRect);

    // adjust the clip rect so that we don't include the text label
    clipRect.bottom =
        getExtendedPaddingTop() - (int) BubbleTextView.PADDING_V + getLayout().getLin@R_404_6440@p(0);

    // Draw the View into the bitmap.
    // The translate of scrollX and scrollY is necessary when drawing TextViews,because
    // they set scrollX and scrollY to large values to achieve centered text
    destCanvas.save();
    destCanvas.scale(getScaleX(),getScaleY(),(getWidth() + padding) / 2,(getHeight() + padding) / 2);
    destCanvas.translate(-getScrollX() + padding / 2,-getScrollY() + padding / 2);
    destCanvas.clipRect(clipRect,Op.REPLACE);
    draw(destCanvas);
    destCanvas.restore();
}
项目:365browser    文件PopupZoomer.java   
/**
 * Sets the bitmap to be used for the zoomed view.
 */
public void setBitmap(Bitmap bitmap) {
    if (mZoomedBitmap != null) {
        mZoomedBitmap.recycle();
        mZoomedBitmap = null;
    }
    mZoomedBitmap = bitmap;

    // Round the corners of the bitmap so it doesn't stick out around the overlay.
    Canvas canvas = new Canvas(mZoomedBitmap);
    Path path = new Path();
    RectF canvasRect = new RectF(0,canvas.getWidth(),canvas.getHeight());
    float overlayCornerRadius = g@R_404_6440@verlayCornerRadius(getContext());
    path.addRoundRect(canvasRect,overlayCornerRadius,Direction.ccw);
    canvas.clipPath(path,Op.XOR);
    Paint clearPaint = new Paint();
    clearPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
    clearPaint.setColor(Color.TRANSPARENT);
    canvas.drawPaint(clearPaint);
}
项目:LeanLauncher    文件Workspace.java   
/**
 * Draw the View v into the given Canvas.
 *
 * @param v the view to draw
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private static void drawDragView(View v,Canvas destCanvas,int padding) {
    final Rect clipRect = stempRect;
    v.getDrawingRect(clipRect);

    destCanvas.save();
    if (v instanceof TextView) {
        Drawable d = ((TextView) v).getCompoundDrawables()[1];
        Rect bounds = getDrawableBounds(d);
        clipRect.set(0,bounds.width() + padding,bounds.height() + padding);
        destCanvas.translate(padding / 2 - bounds.left,padding / 2 - bounds.top);
        d.draw(destCanvas);
    } else {
        destCanvas.translate(-v.getScrollX() + padding / 2,-v.getScrollY() + padding / 2);
        destCanvas.clipRect(clipRect,Op.REPLACE);
        v.draw(destCanvas);
    }
    destCanvas.restore();
}
项目:android-chromium-view    文件PopupZoomer.java   
/**
 * Sets the bitmap to be used for the zoomed view.
 */
public void setBitmap(Bitmap bitmap) {
    if (mZoomedBitmap != null) {
        mZoomedBitmap.recycle();
        mZoomedBitmap = null;
    }
    mZoomedBitmap = bitmap;

    // Round the corners of the bitmap so it doesn't stick out around the overlay.
    Canvas canvas = new Canvas(mZoomedBitmap);
    Path path = new Path();
    RectF canvasRect = new RectF(0,Op.XOR);
    Paint clearPaint = new Paint();
    clearPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
    clearPaint.setColor(Color.TRANSPARENT);
    canvas.drawPaint(clearPaint);
}
项目:androidProject    文件BubbleTextView.java   
/**
 * Draw this BubbleTextView into the given Canvas.
 *
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private void drawWithPadding(Canvas destCanvas,because
    // they set scrollX and scrollY to large values to achieve centered text
    destCanvas.save();
    destCanvas.translate(-getScrollX() + padding / 2,Op.REPLACE);
    draw(destCanvas);
    destCanvas.restore();
}
项目:open-gel-plus    文件BubbleTextView.java   
/**
 * Draw this BubbleTextView into the given Canvas.
 *
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private void drawWithPadding(Canvas destCanvas,Op.REPLACE);
    draw(destCanvas);
    destCanvas.restore();
}
项目:android-chromium    文件PopupZoomer.java   
/**
 * Sets the bitmap to be used for the zoomed view.
 */
public void setBitmap(Bitmap bitmap) {
    if (mZoomedBitmap != null) {
        mZoomedBitmap.recycle();
        mZoomedBitmap = null;
    }
    mZoomedBitmap = bitmap;

    // Round the corners of the bitmap so it doesn't stick out around the overlay.
    Canvas canvas = new Canvas(mZoomedBitmap);
    Path path = new Path();
    RectF canvasRect = new RectF(0,Op.XOR);
    Paint clearPaint = new Paint();
    clearPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
    clearPaint.setColor(Color.TRANSPARENT);
    canvas.drawPaint(clearPaint);
}
项目:Fairphone    文件BubbleTextView.java   
/**
 * Draw this BubbleTextView into the given Canvas.
 *
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private void drawWithPadding(Canvas destCanvas,Op.REPLACE);
    draw(destCanvas);
    destCanvas.restore();
}
项目:chromium_webview    文件PopupZoomer.java   
/**
 * Sets the bitmap to be used for the zoomed view.
 */
public void setBitmap(Bitmap bitmap) {
    if (mZoomedBitmap != null) {
        mZoomedBitmap.recycle();
        mZoomedBitmap = null;
    }
    mZoomedBitmap = bitmap;

    // Round the corners of the bitmap so it doesn't stick out around the overlay.
    Canvas canvas = new Canvas(mZoomedBitmap);
    Path path = new Path();
    RectF canvasRect = new RectF(0,Op.XOR);
    Paint clearPaint = new Paint();
    clearPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
    clearPaint.setColor(Color.TRANSPARENT);
    canvas.drawPaint(clearPaint);
}
项目:Fairphone---DEPRECATED    文件BubbleTextView.java   
/**
 * Draw this BubbleTextView into the given Canvas.
 *
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private void drawWithPadding(Canvas destCanvas,Op.REPLACE);
    draw(destCanvas);
    destCanvas.restore();
}
项目:CustomViews    文件TextWithLinksContainer.java   
private boolean testTouch() {
    mTouchRect.offset(mTouchX,mTouchY);
    Iterator<Region> ir = mRegions.iterator();
    mSelectedRegion = null;
    boolean hit = false;
    while (ir.hasNext()) {
        Region original = ir.next();
        Region region = new Region(original);
        if (region.op(mTouchRect,Op.INTERSECT)) {
            mSelectedRegion = original;
            hit = true;
        }
    }
    mTouchRect.offset(-mTouchX,-mTouchY);
    return hit;
}
项目:cordova-android-chromium    文件PopupZoomer.java   
/**
 * Sets the bitmap to be used for the zoomed view.
 */
public void setBitmap(Bitmap bitmap) {
    if (mZoomedBitmap != null) {
        mZoomedBitmap.recycle();
        mZoomedBitmap = null;
    }
    mZoomedBitmap = bitmap;

    // Round the corners of the bitmap so it doesn't stick out around the overlay.
    Canvas canvas = new Canvas(mZoomedBitmap);
    Path path = new Path();
    RectF canvasRect = new RectF(0,Op.XOR);
    Paint clearPaint = new Paint();
    clearPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
    clearPaint.setColor(Color.TRANSPARENT);
    canvas.drawPaint(clearPaint);
}
项目:LaunchEnr    文件DragPreviewProvider.java   
/**
 * Draws the {@link #mView} into the given {@param destCanvas}.
 */
private void drawDragView(Canvas destCanvas) {
    destCanvas.save();
    if (mView instanceof TextView) {
        Drawable d = Workspace.getTextViewIcon((TextView) mView);
        Rect bounds = getDrawableBounds(d);
        destCanvas.translate(blurSizeOutline / 2 - bounds.left,blurSizeOutline / 2 - bounds.top);
        d.draw(destCanvas);
    } else {
        final Rect clipRect = mTempRect;
        mView.getDrawingRect(clipRect);

        boolean textVisible = false;
        if (mView instanceof FolderIcon) {
            // For FolderIcons the text can bleed into the icon area,and so we need to
            // hide the text completely (which can't be achieved by clipping).
            if (((FolderIcon) mView).getTextVisible()) {
                ((FolderIcon) mView).setTextVisible(false);
                textVisible = true;
            }
        }
        destCanvas.translate(-mView.getScrollX() + blurSizeOutline / 2,-mView.getScrollY() + blurSizeOutline / 2);
        destCanvas.clipRect(clipRect,Op.REPLACE);
        mView.draw(destCanvas);

        // Restore text visibility of FolderIcon if necessary
        if (textVisible) {
            ((FolderIcon) mView).setTextVisible(true);
        }
    }
    destCanvas.restore();
}
项目:boohee_v5.6    文件OverlayView.java   
protected void drawDimmedLayer(@NonNull Canvas canvas) {
    canvas.save();
    if (this.movalDimmedLayer) {
        canvas.clipPath(this.mCircularPath,Op.DIFFERENCE);
    } else {
        canvas.clipRect(this.mCropViewRect,Op.DIFFERENCE);
    }
    canvas.drawColor(this.mDimmedColor);
    canvas.restore();
    if (this.movalDimmedLayer) {
        canvas.drawoval(this.mCropViewRect,this.mDimmedstrokePaint);
    }
}
项目:FlickLauncher    文件DragPreviewProvider.java   
/**
 * Draws the {@link #mView} into the given {@param destCanvas}.
 */
private void drawDragView(Canvas destCanvas) {
    destCanvas.save();
    if (mView instanceof TextView) {
        Drawable d = Workspace.getTextViewIcon((TextView) mView);
        Rect bounds = getDrawableBounds(d);
        destCanvas.translate(DRAG_BITMAP_PADDING / 2 - bounds.left,DRAG_BITMAP_PADDING / 2 - bounds.top);
        d.draw(destCanvas);
    } else {
        final Rect clipRect = mTempRect;
        mView.getDrawingRect(clipRect);

        boolean textVisible = false;
        if (mView instanceof FolderIcon) {
            // For FolderIcons the text can bleed into the icon area,and so we need to
            // hide the text completely (which can't be achieved by clipping).
            if (((FolderIcon) mView).getTextVisible()) {
                ((FolderIcon) mView).setTextVisible(false);
                textVisible = true;
            }
        }
        destCanvas.translate(-mView.getScrollX() + DRAG_BITMAP_PADDING / 2,-mView.getScrollY() + DRAG_BITMAP_PADDING / 2);
        destCanvas.clipRect(clipRect,Op.REPLACE);
        mView.draw(destCanvas);

        // Restore text visibility of FolderIcon if necessary
        if (textVisible) {
            ((FolderIcon) mView).setTextVisible(true);
        }
    }
    destCanvas.restore();
}
项目:SimpleUILauncher    文件DragPreviewProvider.java   
/**
 * Draws the {@link #mView} into the given {@param destCanvas}.
 */
private void drawDragView(Canvas destCanvas) {
    destCanvas.save();
    if (mView instanceof TextView) {
        Drawable d = Workspace.getTextViewIcon((TextView) mView);
        Rect bounds = getDrawableBounds(d);
        destCanvas.translate(DRAG_BITMAP_PADDING / 2 - bounds.left,Op.REPLACE);
        mView.draw(destCanvas);

        // Restore text visibility of FolderIcon if necessary
        if (textVisible) {
            ((FolderIcon) mView).setTextVisible(true);
        }
    }
    destCanvas.restore();
}
项目:SimplOS    文件Workspace.java   
/**
 * Draw the View v into the given Canvas.
 *
 * @param v the view to draw
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private static void drawDragView(View v,int padding) {
    final Rect clipRect = stempRect;
    v.getDrawingRect(clipRect);

    boolean textVisible = false;

    destCanvas.save();
    if (v instanceof TextView) {
        Drawable d = getTextViewIcon((TextView) v);
        Rect bounds = getDrawableBounds(d);
        clipRect.set(0,padding / 2 - bounds.top);
        d.draw(destCanvas);
    } else {
        if (v instanceof FolderIcon) {
            // For FolderIcons the text can bleed into the icon area,and so we need to
            // hide the text completely (which can't be achieved by clipping).
            if (((FolderIcon) v).getTextVisible()) {
                ((FolderIcon) v).setTextVisible(false);
                textVisible = true;
            }
        }
        destCanvas.translate(-v.getScrollX() + padding / 2,Op.REPLACE);
        v.draw(destCanvas);

        // Restore text visibility of FolderIcon if necessary
        if (textVisible) {
            ((FolderIcon) v).setTextVisible(true);
        }
    }
    destCanvas.restore();
}
项目:PaintPlusPlus    文件Selection.java   
void commitSelectionRectangle(Rect rect,Op op)
{
    ActionSelectionChange action = new ActionSelectionChange(image);
    action.s@R_404_6440@ldRegion();

    region.op(rect,op);
    updatePath();

    action.applyAction();
}
项目:Madad_SOS    文件CircleLayout.java   
private void drawChild(Canvas canvas,null);
}
项目:Trebuchet    文件Workspace.java   
/**
 * Draw the View v into the given Canvas.
 *
 * @param v the view to draw
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private static void drawDragView(View v,Op.REPLACE);
        v.draw(destCanvas);

        // Restore text visibility of FolderIcon if necessary
        if (textVisible) {
            ((FolderIcon) v).setTextVisible(true);
        }
    }
    destCanvas.restore();
}
项目:DVBViewerController    文件ShowcaseView.java   
@Override
protected void dispatchDraw(Canvas canvas) {
    if (showcaseX < 0 || showcaseY < 0 || isRedundant) {
        super.dispatchDraw(canvas);
        return;
    }

    boolean recalculatedCling = mShowcaseDrawer.calculateShowcaseRect(showcaseX,showcaseY);
    boolean recalculateText = recalculatedCling || mAlteredText;
    mAlteredText = false;

    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && !mHasNoTarget) {
        Path path = new Path();
        path.addCircle(showcaseX,showcaseY,showcaseRadius,Path.Direction.CW);
        canvas.clipPath(path,Op.DIFFERENCE);
    }

    //Draw background color
    canvas.drawColor(mBackgroundColor);

    // Draw the showcase drawable
    if (!mHasNoTarget) {
        mShowcaseDrawer.drawShowcase(canvas,showcaseX,scaleMultiplier,showcaseRadius);
    }

    // Draw the text on the screen,recalculating its position if necessary
    if (recalculateText) {
        mTextDrawer.calculateTextPosition(canvas.getWidth(),canvas.getHeight(),this);
    }
    mTextDrawer.draw(canvas,recalculateText);

    super.dispatchDraw(canvas);

}
项目:WeiboWeiBaTong    文件ShowcaseView.java   
@Override
protected void dispatchDraw(Canvas canvas) {
    if (showcaseX < 0 || showcaseY < 0 || isRedundant) {
        super.dispatchDraw(canvas);
        return;
    }

    boolean recalculatedCling = mShowcaseDrawer.calculateShowcaseRect(showcaseX,Op.DIFFERENCE);
    }

    //Draw background color
    canvas.drawColor(mBackgroundColor);

    // Draw the showcase drawable
    if (!mHasNoTarget) {
        mShowcaseDrawer
                .drawShowcase(canvas,recalculateText);

    super.dispatchDraw(canvas);

}
项目:PdDroidPublisher    文件Subpatch.java   
protected void drawSubpatchContent(Canvas canvas)
{
    canvas.save();
    Matrix matrix = new Matrix();
    matrix.postTranslate(x - HMargin,y - VMargin);
    canvas.concat(matrix);
    canvas.clipRect(new RectF(HMargin,VMargin,HMargin + dRect.width(),VMargin + dRect.height()),Op.INTERSECT);
    for(Widget widget : widgets)
    {
        widget.draw(canvas);
    }
    canvas.restore();
}
项目:PdDroidPublisher    文件Slider.java   
public void draw(Canvas canvas) {
    canvas.save();
    canvas.clipRect(dRect.left,dRect.top,dRect.right,dRect.bottom + 1,Op.INTERSECT);
    if (bg.draw(canvas)) {
        paint.setColor(bgcolor);
        paint.setStyle(Paint.Style.FILL);
        canvas.drawRect(dRect,paint);

        paint.setColor(fgcolor);
        paint.setstrokeWidth(1);
        canvas.drawLine(dRect.left /*+ 1*/,paint);
        canvas.drawLine(dRect.left /*+ 1*/,dRect.bottom,paint);
        canvas.drawLine(dRect.left,dRect.top /*+ 1*/,dRect.left,paint);
        canvas.drawLine(dRect.right,paint);
        paint.setColor(fgcolor);
        paint.setstrokeWidth(3);
        if (horizontal) {
            canvas.drawLine(Math.round(dRect.left + getnormalizedPosition() * dRect.width()),Math.round(dRect.top /*+ 2*/),Math.round(dRect.left + getnormalizedPosition() * dRect.width()),Math.round(dRect.bottom /*- 2*/),paint);
        } else {
            canvas.drawLine(Math.round(dRect.left /*+ 2*/),Math.round(dRect.bottom - getnormalizedPosition() * dRect.height()),Math.round(dRect.right /*- 2*/),paint);
        }

    } else if (!slider.none()) {
        if (horizontal) {
            sRect.offsetTo(getnormalizedPosition() * (dRect.width() - sRect.width()) + dRect.left,dRect.top);
        } else {
            sRect.offsetTo(dRect.left,(1 - getnormalizedPosition()) * (dRect.height() - sRect.height()) + dRect.top);
        }
        slider.draw(canvas,sRect);
        fg.draw(canvas);
    }
    canvas.restore();
    drawLabel(canvas);
}
项目:FLauncher    文件Workspace.java   
/**
 * Draw the View v into the given Canvas.
 *
 * @param v the view to draw
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private static void drawDragView(View v,Op.REPLACE);
        v.draw(destCanvas);

        // Restore text visibility of FolderIcon if necessary
        if (textVisible) {
            ((FolderIcon) v).setTextVisible(true);
        }
    }
    destCanvas.restore();
}
项目:@R_502_4313@app    文件ClipImageBorderView.java   
/**
 * 画圆形窗口
 * 
 * @param canvas
 * @param view
 * @return
 */
private Canvas drawCircleWingdow(Canvas canvas,View view) {
    canvas.save();
    Path path = new Path();

    // 计算矩形区域的宽度
    int witdh = getClipwindowWidth();
    // 中心坐标
    int centerX = getWidth() / 2;
    int centerY = getHeight() / 2;
    // 半径
    int radius = witdh / 2;
    Paint paint = new Paint();
    paint.setAntiAlias(true);
    paint.setColor(Color.parseColor("#aa000000"));
    paint.setStyle(Style.FILL);

    Rect viewDrawingRect = new Rect();
    view.getDrawingRect(viewDrawingRect);

    path.addCircle(centerX,centerY,radius,Direction.CW);
    // 画外边
    canvas.clipPath(path,Op.DIFFERENCE);
    canvas.drawRect(viewDrawingRect,paint);
    // Todo 绘制外边框
    // 绘制外边框
    // canvas.restore();
    // canvas.clipPath(path,Op.INTERSECT);
    // paint.setColor(mBorderColor);
    // paint.setstrokeWidth(mBorderWidth);
    // paint.setStyle(Style.stroke);
    // canvas.drawRect(viewDrawingRect,paint);

    canvas.restore();
    return canvas;
}
项目:svg-android-2    文件SVGParser.java   
private void dobitmap(Canvas canvas,float x,float y,float width,float height,byte[] bytes) {
     Bitmap bm = BitmapFactory.decodeByteArray(bytes,bytes.length);
     if (bm != null) {
// Log.d(TAG,String.format("Image %f x %f %s",width,height,bm));
       bm.prepar@R_404_6440@Draw();
       Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG | Paint.ANTI_ALIAS_FLAG);
          RectF rect = new RectF(x,y,x+width,y+height);
          canvas.clipRect(rect,Op.REPLACE);
          canvas.drawBitmap(bm,null,rect,paint);
          bm.recycle();
     }
}
项目:LB-Launcher    文件Workspace.java   
/**
 * Draw the View v into the given Canvas.
 *
 * @param v the view to draw
 * @param destCanvas the canvas to draw on
 * @param padding the horizontal and vertical padding to use when drawing
 */
private static void drawDragView(View v,int padding) {
    final Rect clipRect = stempRect;
    v.getDrawingRect(clipRect);

    boolean textVisible = false;

    destCanvas.save();
    if (v instanceof TextView) {
        Drawable d = ((TextView) v).getCompoundDrawables()[1];
        Rect bounds = getDrawableBounds(d);
        clipRect.set(0,Op.REPLACE);
        v.draw(destCanvas);

        // Restore text visibility of FolderIcon if necessary
        if (textVisible) {
            ((FolderIcon) v).setTextVisible(true);
        }
    }
    destCanvas.restore();
}
项目:Beats    文件GUIGame.java   
@Override
public void setClip_arrowSpace(Canvas canvas) {
    /* Note: if we need midpt to depend on button locations or something,* we can move the logic of this method to GUIHandler
     * (in the same manner as tim@R_404_6440@Y and pitchToX) */
    boolean fallingDown = false;
    switch (Tools.gameMode) {
        case Tools.STANDARD: fallingDown = false;    break;
        case Tools.REVERSE:  fallingDown = true;     break;
        case Tools.OSU_MOD:  setClip_screen(canvas); return;
    }
    int ymin,ymax,midpt;
    switch (noteAppearance) {
    case 1: //Hidden (appear,then disappear)
        midpt = Tools.screen_h / 2 - Tools.button_h;
        ymin = fallingDown ? 0     : (Tools.screen_h - midpt);
        ymax = fallingDown ? midpt : Tools.screen_h;
        break;
    case 2: //Sudden (appear very late)
        midpt = Tools.screen_h / 2 - Tools.button_h;
        ymin = fallingDown ? midpt          : 0;
        ymax = fallingDown ? Tools.screen_h : (Tools.screen_h - midpt);
        break;
    case 3: // Invisible (never appear)
        ymin = -1;
        ymax = -1;
        break;
    case 0: default: //Visible (normal)
        ymin = 0;
        ymax = Tools.screen_h;
        break;
    }
    canvas.clipRect(0,ymin,Tools.screen_w,Op.REPLACE);
}
项目:android-app-framework    文件ShowcaseView.java   
@Override
protected void dispatchDraw(Canvas canvas) {
    if (showcaseX < 0 || showcaseY < 0 || isRedundant) {
        super.dispatchDraw(canvas);
        return;
    }

    boolean recalculatedCling = mShowcaseDrawer.calculateShowcaseRect(showcaseX,recalculateText);

    super.dispatchDraw(canvas);

}
项目:One    文件ClipCircleArea.java   
protected static void clipArea1(float angle,int r,Canvas canvas) {
    if(angle > 45)angle = 45;
    mPath.reset();
    mPath.mov@R_404_6440@(r,r);
    mPath.lin@R_404_6440@(r,0);
    mPath.lin@R_404_6440@((int)(r + r*Math.tan(geTradian(angle))),0);
    Log.d("ClipCircleArea","r:"+r+" dot:"+(int)(r + r*Math.tan(geTradian(angle))));
    mPath.lin@R_404_6440@(r,r);
    canvas.clipPath(mPath,Op.UNION);
}
项目:One    文件ClipCircleArea.java   
protected static void clipArea2(float angle,Canvas canvas) {
    if(angle > 90)angle = 90;
    mPath.reset();
    mPath.mov@R_404_6440@(r,r);
    mPath.lin@R_404_6440@(2*r,0);
    mPath.lin@R_404_6440@(2*r,(int)( r - r*Math.tan(geTradian(90 - angle))));
    mPath.lin@R_404_6440@(r,Op.UNION);
}
项目:One    文件ClipCircleArea.java   
protected static void clipArea3(float angle,Canvas canvas) {
    if(angle > 135)angle = 135;
    mPath.reset();
    mPath.mov@R_404_6440@(r,(int)(r + r*Math.tan(geTradian(angle-90))));
    mPath.lin@R_404_6440@(r,Op.UNION);
}
项目:One    文件ClipCircleArea.java   
protected static void clipArea4(float angle,Canvas canvas) {
    if(angle > 180)angle = 180;
    mPath.reset();
    mPath.mov@R_404_6440@(r,2*r);
    mPath.lin@R_404_6440@((int)(r + r * Math.tan(geTradian(180-angle))),2*r);
    mPath.lin@R_404_6440@(r,Op.UNION);
}
项目:One    文件ClipCircleArea.java   
protected static void clipArea5(float angle,Canvas canvas) {
    if(angle > 225)angle = 225;
    mPath.reset();
    mPath.mov@R_404_6440@(r,2*r);
    mPath.lin@R_404_6440@((int)(r - r*Math.tan(geTradian(angle-180))),Op.UNION);
}
项目:One    文件ClipCircleArea.java   
protected static void clipArea6(float angle,Canvas canvas) {
    if(angle > 270)angle = 270;
    mPath.reset();
    mPath.mov@R_404_6440@(r,r);
    mPath.lin@R_404_6440@(0,2*r);
    mPath.lin@R_404_6440@(0,(int)(r + r*Math.tan(geTradian(270-angle))));
    mPath.lin@R_404_6440@(r,Op.UNION);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。